rubocop-kata 0.10.0 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0d5931b8e8bdf39595150f5f4c4785fd1e7c267c4abfda47d02999913aa4bdd2
4
- data.tar.gz: 56fdf88f035c7833469f0a290351696b2a1197f1f5cee2282ad60928201b3323
3
+ metadata.gz: 67fd1df1d6f816ac27f7969320250449416c2b71980ef0dadd39a1d78207f4cb
4
+ data.tar.gz: f83bb88a676abf910f72fbbedf3dfc9dfc9176eded439eb8023c6a27d8d71cf1
5
5
  SHA512:
6
- metadata.gz: 122b3da618e42d4137b1c4986bd21ba63374e275168d84181afa87cfae319465fe07270d12d54c3cece22ac6b73585a137d7ac5780f22f5a9c4fb0f667a40a07
7
- data.tar.gz: b9bfb1dc0d5be32ea85898cfae3fbe3ce3338578f2e57b1e7b9effd2e00b2847c50bedcb5f9d259292de8141fe3579e11b0bb925a9840534047f26577f5dff26
6
+ metadata.gz: 2afc835dcecd65616f50ebb5f5eb192fafb21260e934053277b92f960f8d00823e717e3267de944ad83fa4a23669c22a531afe60bdad608afef4ef4f81905bbd
7
+ data.tar.gz: 2ff3ae8982141f62ed38135363951b2d911bc0c1c46158dd7a691f2092a08f771c2d32411d24444beb2ec143b138f7d78518f2b7968e44cebe6462ec62f7f7db
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## [Unreleased]
4
+
5
+ ## [0.10.1] - 2026-09-26
6
+
7
+ - `Kata/ClassInModule` names the class in its message again: it read
8
+ `Class {name: "Foo"} must be…` because the name went in as a keyword.
9
+ - `rubocop-kata plan` keeps its "these mint the names `naming` then prices"
10
+ note for the `structure` stage; it was also printed when `naming` or `prose`
11
+ came next, where it does not hold.
12
+ - Mutation testing with Kimera (`.kimera.yml`, `bundle exec kimera run`) now
13
+ kills every mutant in `lib/`; the specs that got there pin the argument and
14
+ class-variable hooks, the boundaries, and the correctors' edge cases. Dead
15
+ guards it surfaced in `NoRedundantVariable`'s helpers and `doctor` are gone.
16
+ CI keeps it there with `kimera ci`: pull requests gate on the lines they
17
+ change, pushes to `main` on the full run.
18
+
3
19
  ## [0.10.0] - 2026-08-30
4
20
 
5
21
  - `Elegant/NoRedundantVariable`, `Elegant/PairedBrackets`, and
@@ -11,7 +11,7 @@ class RuboCop::Cop::Kata::ClassInModule < RuboCop::Cop::Base
11
11
  def on_class(node)
12
12
  return if namespaced?(node)
13
13
  return if scoped?(node)
14
- add_offense(node, message: format(MSG, name: label(node)))
14
+ add_offense(node, message: format(MSG, label(node)))
15
15
  end
16
16
 
17
17
  private
@@ -38,15 +38,11 @@ class RuboCop::Cop::Kata::NoRedundantVariable < RuboCop::Cop::Base
38
38
  end
39
39
 
40
40
  def swallows?(assign, singles)
41
- range = assign.source_range
42
- singles.any? do |_, read|
43
- read.source_range.begin_pos > range.begin_pos && read.source_range.end_pos <= range.end_pos
44
- end
41
+ singles.any? { |_, read| assign.source_range.contains?(read.source_range) }
45
42
  end
46
43
 
47
44
  def solo?(assign)
48
45
  range = assign.source_range
49
- return false unless range.first_line == range.last_line
50
46
  range.source_buffer.source_line(range.first_line).strip == range.source.strip
51
47
  end
52
48
  end
@@ -40,7 +40,7 @@ class RuboCop::Kata::Checkup
40
40
 
41
41
  def off?(key) = project.dig(key, "Enabled") == false
42
42
 
43
- def project = @_project ||= (YAML.safe_load_file(file, aliases: true) if File.file?(file)) || {}
43
+ def project = @_project ||= YAML.safe_load_file(file, aliases: true) || {}
44
44
 
45
45
  def dead = targets.flat_map { directives(it) }
46
46
 
@@ -69,7 +69,7 @@ class RuboCop::Kata::Plan
69
69
  format(NEXT, stage, picked.length, plural(picked), files.length, plural(files), note(stage))
70
70
  end
71
71
 
72
- def note(stage) = stage == REST ? "" : MINTS
72
+ def note(stage) = stage == "structure" ? MINTS : ""
73
73
 
74
74
  def hottest(picked) = picked.map { it.fetch("path") }.tally.max_by(&:last)
75
75
 
@@ -36,7 +36,6 @@ class RuboCop::Kata::Variable::Gap
36
36
  def before(parent, child, assign)
37
37
  kids = parent.children
38
38
  stop = kids.index { it.equal?(child) }
39
- return [] if stop.nil?
40
39
  kids[(parent.equal?(assign.parent) ? kids.index { it.equal?(assign) } + 1 : 0)...stop]
41
40
  end
42
41
 
@@ -23,14 +23,10 @@ class RuboCop::Kata::Variable::Inlining
23
23
 
24
24
  def pair
25
25
  parent = @read.parent
26
- return if parent.nil? || !parent.pair_type?
27
- key, value = parent.children
28
- parent if value.equal?(@read) && key.source_range == value.source_range
26
+ parent if parent.pair_type? && parent.value_omission?
29
27
  end
30
28
 
31
- def value = wrap? ? "(#{braced})" : braced
32
-
33
- def braced = @rhs.hash_type? && @rhs.loc.begin.nil? ? "{ #{@rhs.source} }" : @rhs.source
29
+ def value = wrap? ? "(#{@rhs.source})" : @rhs.source
34
30
 
35
31
  def wrap? = !primary? || (@rhs.hash_type? && bare?)
36
32
 
@@ -31,20 +31,19 @@ class RuboCop::Kata::Variable::Ledger
31
31
 
32
32
  def tainted
33
33
  nodes.select { it.op_asgn_type? || it.or_asgn_type? || it.and_asgn_type? }.map { it.children.first }
34
- .select { it.is_a?(RuboCop::AST::Node) && it.lvasgn_type? }.map { it.children.first }
34
+ .select(&:lvasgn_type?).map { it.children.first }
35
35
  end
36
36
 
37
37
  def nodes(node = @body, found = [])
38
- return found unless node.is_a?(RuboCop::AST::Node) && !node.def_type? && !node.defs_type?
38
+ return found if node.def_type? || node.defs_type?
39
39
  found << node
40
40
  node.each_child_node { nodes(it, found) }
41
41
  found
42
42
  end
43
43
 
44
44
  def statement?(node)
45
- return false unless node.children.size == 2
46
45
  parent = node.parent
47
- parent = parent.parent while !parent.nil? && parent.type == :begin && parent.children.size == 1
48
- !parent.nil? && STATEMENT_PARENTS.include?(parent.type)
46
+ parent = parent.parent while parent.type == :begin && parent.children.size == 1
47
+ STATEMENT_PARENTS.include?(parent.type)
49
48
  end
50
49
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RuboCop
4
4
  module Kata
5
- VERSION = "0.10.0"
5
+ VERSION = "0.10.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-kata
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Giacomo GK