rubocop-vicenzo 0.1.0 → 0.1.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: 93a0df32e2fd3e164d0b7380c341fe12eb61a46143f4ec15f990961d72d1a611
4
- data.tar.gz: ff138db061137acee6d7067d4cb9e3301d36f6ea33dac8cd494d9a616c8c2ac6
3
+ metadata.gz: ed82c28ffcefb60cfdace3b56e7076dccfdfc8bdd936250554ee3adb99c74903
4
+ data.tar.gz: fc149cec1118966ed088ddf9b0d6b9f2375c25d364396fb5d2069991337dc2ac
5
5
  SHA512:
6
- metadata.gz: 0b5ddd5178c5866f85d86624f5709cb52a51444b2077363e2a73242feaeb80933e435e8009edbff123e786f01a671e7b7e0d8946e1e06096cb7dc747967f9ab1
7
- data.tar.gz: d79145ff57444fa82a3a4dd89375821b77755841eeac1b373698784bab36a7c4448f609c4733de6b1206460684d3db3ab423b234ef661ad423ac47ea4df38c65
6
+ metadata.gz: 79466db290631d6846ac960fcc8c30c7feb6b89e824443ada09c42f7b4d57a474268fe7c9fa37a686297bfcf538d715190da643dbeb53633c866e9dba3d3bf36
7
+ data.tar.gz: a0f924f733ba96918a8b5199f9a876c168184cc52cd476c3a3976929edc9cac2239ccf2fbc53e617c6cb340d60de4bf72a46a9d7072de675b461a83c1581b47e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.1.1] - 2025-08-12
4
+
5
+ - Add Rightly enable all cops #7;
6
+ - Fix RuboCop::Cop::Vicenzo::Rails::EnumInclusionOfValidation working with array format and no options #7;
7
+
3
8
  ## [0.1.0] - 2025-04-02
4
9
 
5
10
  - Initial release;
data/config/default.yml CHANGED
@@ -1,11 +1,19 @@
1
+ Vicenzo/Rails/EnumInclusionOfValidation:
2
+ Description: 'Check if the enum has the inclusion of validation defined.'
3
+ Enabled: true
4
+ Severity: convention
5
+ VersionAdded: '0.1.0'
6
+
1
7
  Vicenzo/RSpec/MixedExampleGroups:
2
8
  Description: 'Check if there are example and groups at same level'
3
- Enabled: warning
9
+ Enabled: true
10
+ Severity: warning
4
11
  VersionAdded: '0.1.0'
5
12
 
6
13
  Vicenzo/RSpec/NestedContextImproperStart:
7
14
  Description: 'Check if the nested context does not start as a root one.'
8
- Enabled: warning
15
+ Enabled: true
16
+ Severity: convention
9
17
  VersionAdded: '0.1.0'
10
18
 
11
19
  Vicenzo/RSpec/NestedLetRedefinition:
@@ -16,10 +24,6 @@ Vicenzo/RSpec/NestedLetRedefinition:
16
24
 
17
25
  Vicenzo/RSpec/NestedSubjectRedefinition:
18
26
  Description: 'Check if a subject is redefined in a nested example group.'
19
- Enabled: warning
20
- VersionAdded: '0.1.0'
21
-
22
- Vicenzo/Rails/EnumInclusionOfValidation:
23
- Description: 'Check if the enum has the inclusion of validation defined.'
24
- Enabled: convention
27
+ Enabled: true
28
+ Severity: warning
25
29
  VersionAdded: '0.1.0'
@@ -52,7 +52,7 @@ module RuboCop
52
52
  private
53
53
 
54
54
  def find_validate_option(enum_node)
55
- enum_node.last_argument.each_pair.find { |pair| pair.key.value == :validate }
55
+ options_node_for(enum_node)&.each_pair&.find { |pair| pair.key.value == :validate }
56
56
  end
57
57
 
58
58
  def valid_validate_option?(validate_kwarg)
@@ -62,14 +62,15 @@ module RuboCop
62
62
  end
63
63
  end
64
64
 
65
- def last_hash_node(enum_node)
65
+ def options_node_for(enum_node)
66
66
  enum_node.last_argument if enum_node.last_argument.hash_type?
67
67
  end
68
68
 
69
69
  def register_offence_for(enum_node, validate_kwarg)
70
70
  if validate_kwarg.nil?
71
71
  add_offense(enum_node, message: MSG_MISSING_VALIDATE) do |corrector|
72
- corrector.insert_after(last_hash_node(enum_node), ', validate: { allow_nil: true }')
72
+ last_node = options_node_for(enum_node) || enum_node.last_argument
73
+ corrector.insert_after(last_node, ', validate: { allow_nil: true }')
73
74
  end
74
75
  elsif !valid_validate_option?(validate_kwarg)
75
76
  add_offense(validate_kwarg, message: MSG_INVALID_VALIDATE) do |corrector|
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RuboCop
4
4
  module Vicenzo
5
- VERSION = '0.1.0'
5
+ VERSION = '0.1.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-vicenzo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bruno Vicenzo
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-04-02 00:00:00.000000000 Z
10
+ date: 2025-08-12 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: lint_roller
@@ -51,7 +51,8 @@ dependencies:
51
51
  - - ">="
52
52
  - !ruby/object:Gem::Version
53
53
  version: 3.5.0
54
- description: Cops with good pratices I have been learning
54
+ description: A growing set of custom RuboCop cops capturing the best practices I've
55
+ been learning.
55
56
  email:
56
57
  - bruno@alumni.usp.br
57
58
  executables: []