hubbado-style 1.5.2 → 1.6.0

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: 9f3a281636b742d81c45f804d0d65e8966ffed88b215da287f3cbe735218f68e
4
- data.tar.gz: dbb7802765d29119980488f822c536d5a945c9aba9aae84bc0983c2a2002588a
3
+ metadata.gz: '080cf7668c5aced2d708ac51c8702c60103675f924f675625381e6837cf3998f'
4
+ data.tar.gz: ddbbb37d44f541ec1fe25bcfb5b00469409f0c53e5a6d9d0ebf31a42d5d94a4a
5
5
  SHA512:
6
- metadata.gz: 0eebbca11b442677d15512dd902c107b5a022063b7cfebada42190feb93d692edfd858f30c50337ee97db4069d1c656579eb58809c73599aa08e12dfd83e0ad0
7
- data.tar.gz: 901dc8f390cc602188df82ce5da0db1daab5f648869f6992fa07bc97dc4016522d6e34379c3195a5873fbd12a0fd9817980ba6155a6e7787b746df5a40d3ad95
6
+ metadata.gz: 71e8fd91decfd0dd6d38d1173f6b14b1924a5a375d90456464665bc76bc57cc0244cbd44fdc4a598ed999e6c75c7ec03661e81dde697a77ed353115ea61f3719
7
+ data.tar.gz: 0d128c24d901c747b8a2d203425bae2151eff245ddf644a3add5660418ad0dda02defe09f20fb86b0c46735342cd54a727492b7306bbd81b4082d45fec23a8ef
data/ChangeLog.md ADDED
@@ -0,0 +1,69 @@
1
+ # Change Log
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog](http://keepachangelog.com/)
5
+ and this project adheres to [Semantic Versioning](http://semver.org/).
6
+
7
+ # [1.6.0 - 2026-11-01]
8
+ ## Added
9
+ - Hubbado/UnusedMethodArgument, which replaces Lint/UnusedMethodArgument and
10
+ ignores the arguments of a `record def`
11
+ - Layout/FirstMethodParameterLineBreak and
12
+ Layout/MultilineMethodParameterLineBreaks enabled
13
+ - Settings from hubbado_core: SuggestExtensions, Metrics/ModuleLength,
14
+ Naming/AccessorMethodName, Naming/VariableNumber, Style/Alias,
15
+ Style/EmptyClassDefinition, Style/FloatDivision, Style/HashAsLastArrayItem
16
+ and Lint/AmbiguousOperatorPrecedence disabled; Naming/BlockForwarding
17
+ explicit; Style/ArgumentsForwarding not anonymous;
18
+ Lint/UnusedMethodArgument not autocorrected; Style/FormatStringToken and
19
+ Lint/ConstantDefinitionInBlock skip specs
20
+
21
+ ## Changed
22
+ - Layout/ParameterAlignment uses with_fixed_indentation
23
+ - Style/HashSyntax EnforcedShorthandSyntax is either_consistent
24
+ - Target ruby version 4.0
25
+
26
+ ## Migration
27
+ - Rename a `.rubocop.yml` override of Lint/UnusedMethodArgument to
28
+ Hubbado/UnusedMethodArgument
29
+ - Delete `# rubocop:disable Lint/UnusedMethodArgument` on a `record def`
30
+ (`rubocop -a` does this), and rename it to Hubbado/UnusedMethodArgument on
31
+ any other method
32
+
33
+ # [1.5.2 - 2025-06-16]
34
+ ## Fixed
35
+ - Naming/PredicateName renamed to Naming/PredicatePrefix
36
+
37
+ # [1.5.1 - 2025-05-30]
38
+ - Bumped version to publish package in rubygems
39
+
40
+ # [1.5.0 - 2025-04-11]
41
+ ## Changed
42
+ - Style/IfUnlessModifier disabled
43
+ - Target ruby version 3.4
44
+
45
+ # [1.4.0 - 2023-04-17]
46
+ ## Added
47
+ - Disable Metrics/ParameterLists
48
+
49
+ # [1.3.0 - 2023-04-05]
50
+ ## Changed
51
+ - Added EnforcedShorthandSyntax: never to Style/HashSyntax
52
+ - Target ruby version 3.2
53
+
54
+ # [1.2.0 - 2023-01-24]
55
+ ## Changed
56
+ - Target ruby version 3.1
57
+
58
+ # [1.1.0 - 2020-03-16]
59
+ ## Changed
60
+ - Do not report on Metrics/AbcSize, Metrics/BlockLength,
61
+ Metrics/CyclomaticComplexity or Metrics/PerceivedComplexity
62
+
63
+ # [1.0.1 - 2021-04-10]
64
+ ## Fixed
65
+ - Don't scan the gems directory
66
+
67
+ # [1.0.0 - 2021-04-10]
68
+ ## Added
69
+ - Fix version of this gem, using our Rails monolith Rubocop configuration as a base
data/default.yml CHANGED
@@ -1,3 +1,6 @@
1
+ require:
2
+ - hubbado/style
3
+
1
4
  AllCops:
2
5
  Include:
3
6
  - '**/*.rb'
@@ -8,8 +11,9 @@ AllCops:
8
11
  - db/**
9
12
  - config/**
10
13
  - script/**
11
- TargetRubyVersion: 3.4
14
+ TargetRubyVersion: 4.0
12
15
  NewCops: enable
16
+ SuggestExtensions: false
13
17
 
14
18
  Metrics/AbcSize:
15
19
  Enabled: false
@@ -26,19 +30,42 @@ Metrics/CyclomaticComplexity:
26
30
  Metrics/MethodLength:
27
31
  Enabled: false
28
32
 
33
+ # All spec files are basically one giant module
34
+ # Sometimes we include the spec in a module, as RSpec doesn't support include properly
35
+ Metrics/ModuleLength:
36
+ Enabled: false
37
+
29
38
  Metrics/ParameterLists:
30
39
  Enabled: false
31
40
 
32
41
  Metrics/PerceivedComplexity:
33
42
  Enabled: false
34
43
 
44
+ # We will use our own judgement here
45
+ Naming/AccessorMethodName:
46
+ Enabled: false
47
+
48
+ Naming/BlockForwarding:
49
+ EnforcedStyle: explicit
50
+
35
51
  Naming/PredicatePrefix:
36
52
  ForbiddenPrefixes:
37
53
  - is_
38
54
 
55
+ # We will use our own judgement here
56
+ Naming/VariableNumber:
57
+ Enabled: false
58
+
39
59
  Style/AccessorGrouping:
40
60
  Enabled: false
41
61
 
62
+ # We will use our own judgement here
63
+ Style/Alias:
64
+ Enabled: false
65
+
66
+ Style/ArgumentsForwarding:
67
+ UseAnonymousForwarding: false
68
+
42
69
  Style/BlockDelimiters:
43
70
  EnforcedStyle: line_count_based
44
71
  Exclude:
@@ -47,11 +74,28 @@ Style/BlockDelimiters:
47
74
  Style/Documentation:
48
75
  Enabled: false
49
76
 
77
+ # One-liner `Foo = Class.new(Bar)` is preferred for empty exception classes
78
+ Style/EmptyClassDefinition:
79
+ Enabled: false
80
+
81
+ # This gets it wrong when we want to divide money by money as floats
82
+ Style/FloatDivision:
83
+ Enabled: false
84
+
85
+ # Gets confused with %{first} in YAML strings in tests
86
+ Style/FormatStringToken:
87
+ Exclude:
88
+ - 'spec/**/*'
89
+
50
90
  Style/FrozenStringLiteralComment:
51
91
  Enabled: false
52
92
 
93
+ # Unnecessary {} when this is enabled
94
+ Style/HashAsLastArrayItem:
95
+ Enabled: false
96
+
53
97
  Style/HashSyntax:
54
- EnforcedShorthandSyntax: never
98
+ EnforcedShorthandSyntax: either_consistent
55
99
 
56
100
  Style/IfUnlessModifier:
57
101
  Enabled: false
@@ -84,6 +128,9 @@ Layout/CaseIndentation:
84
128
  Layout/EmptyLineAfterGuardClause:
85
129
  Enabled: false
86
130
 
131
+ Layout/FirstMethodParameterLineBreak:
132
+ Enabled: true
133
+
87
134
  Layout/MultilineBlockLayout:
88
135
  Exclude:
89
136
  - 'spec/**/*'
@@ -92,6 +139,12 @@ Layout/MultilineMethodCallIndentation:
92
139
  EnforcedStyle: indented
93
140
  IndentationWidth: 2
94
141
 
142
+ Layout/MultilineMethodParameterLineBreaks:
143
+ Enabled: true
144
+
145
+ Layout/ParameterAlignment:
146
+ EnforcedStyle: with_fixed_indentation
147
+
95
148
  Layout/LineLength:
96
149
  Max: 100
97
150
 
@@ -100,6 +153,28 @@ Lint/AmbiguousBlockAssociation:
100
153
  Exclude:
101
154
  - 'spec/**/*'
102
155
 
156
+ # We know mathematical precedence so this is unnecessary
157
+ Lint/AmbiguousOperatorPrecedence:
158
+ Enabled: false
159
+
160
+ # Constants have to be created and assigned in RSpec blocks
161
+ Lint/ConstantDefinitionInBlock:
162
+ Exclude:
163
+ - 'spec/**/*'
164
+
165
+ Lint/UnusedMethodArgument:
166
+ Enabled: false
167
+
168
+ Hubbado/UnusedMethodArgument:
169
+ Enabled: true
170
+ Severity: warning
171
+ AutoCorrect: false
172
+ AllowUnusedKeywordArguments: false
173
+ IgnoreEmptyMethods: true
174
+ IgnoreNotImplementedMethods: true
175
+ NotImplementedExceptions:
176
+ - NotImplementedError
177
+
103
178
  Lint/UselessAccessModifier:
104
179
  MethodCreatingMethods:
105
180
  - delegate
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "hubbado-style"
3
- s.version = "1.5.2"
3
+ s.version = "1.6.0"
4
4
  s.summary = "Hubbado style guides and shared style configs."
5
5
 
6
6
  s.authors = ["Hubbado Devs"]
@@ -11,6 +11,7 @@ Gem::Specification.new do |s|
11
11
  s.require_paths = ["lib"]
12
12
 
13
13
  s.files = Dir.glob(%w[
14
+ lib/**/*.rb
14
15
  default.yml
15
16
  *.gemspec
16
17
  LICENSE*
@@ -22,4 +23,5 @@ Gem::Specification.new do |s|
22
23
 
23
24
  s.add_development_dependency "bundler"
24
25
  s.add_development_dependency "rake"
26
+ s.add_development_dependency "test_bench"
25
27
  end
@@ -0,0 +1,19 @@
1
+ # Finds unused method arguments, except in a `record def`, where a substitute keeps
2
+ # parameters it does not use because `record` reads their names
3
+ module RuboCop
4
+ module Cop
5
+ module Hubbado
6
+ class UnusedMethodArgument < Lint::UnusedMethodArgument
7
+ def_node_matcher :record?, "(send nil? :record def)"
8
+
9
+ private
10
+
11
+ def check_argument(variable)
12
+ return if record?(variable.scope.node.parent)
13
+
14
+ super
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,4 @@
1
+ # Loads the Hubbado cops that default.yml enables, for a RuboCop run that inherits it
2
+ require "rubocop"
3
+
4
+ require "hubbado/style/unused_method_argument"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hubbado-style
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.2
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hubbado Devs
@@ -51,17 +51,33 @@ dependencies:
51
51
  - - ">="
52
52
  - !ruby/object:Gem::Version
53
53
  version: '0'
54
+ - !ruby/object:Gem::Dependency
55
+ name: test_bench
56
+ requirement: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ type: :development
62
+ prerelease: false
63
+ version_requirements: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
54
68
  email:
55
69
  - devs@hubbado.com
56
70
  executables: []
57
71
  extensions: []
58
72
  extra_rdoc_files: []
59
73
  files:
60
- - CHANGELOG.md
74
+ - ChangeLog.md
61
75
  - LICENSE
62
76
  - README.md
63
77
  - default.yml
64
78
  - hubbado-style.gemspec
79
+ - lib/hubbado/style.rb
80
+ - lib/hubbado/style/unused_method_argument.rb
65
81
  homepage: https://github.com/hubbado/hubbado-style
66
82
  licenses:
67
83
  - MIT
@@ -80,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
96
  - !ruby/object:Gem::Version
81
97
  version: '0'
82
98
  requirements: []
83
- rubygems_version: 3.6.7
99
+ rubygems_version: 4.0.20
84
100
  specification_version: 4
85
101
  summary: Hubbado style guides and shared style configs.
86
102
  test_files: []
data/CHANGELOG.md DELETED
@@ -1,43 +0,0 @@
1
- # Change Log
2
- All notable changes to this project will be documented in this file.
3
-
4
- The format is based on [Keep a Changelog](http://keepachangelog.com/)
5
- and this project adheres to [Semantic Versioning](http://semver.org/).
6
-
7
- # [1.5.2 - 2025-06-16]
8
- ## Fixed
9
- - Naming/PredicateName renamed to Naming/PredicatePrefix
10
-
11
- # [1.5.1 - 2025-05-30]
12
- - Bumped version to publish package in rubygems
13
-
14
- # [1.5.0 - 2025-04-11]
15
- ## Changed
16
- - Style/IfUnlessModifier disabled
17
- - Target ruby version 3.4
18
-
19
- # [1.4.0 - 2023-04-17]
20
- ## Added
21
- - Disable Metrics/ParameterLists
22
-
23
- # [1.3.0 - 2023-04-05]
24
- ## Changed
25
- - Added EnforcedShorthandSyntax: never to Style/HashSyntax
26
- - Target ruby version 3.2
27
-
28
- # [1.2.0 - 2023-01-24]
29
- ## Changed
30
- - Target ruby version 3.1
31
-
32
- # [1.1.0 - 2020-03-16]
33
- ## Changed
34
- - Do not report on Metrics/AbcSize, Metrics/BlockLength,
35
- Metrics/CyclomaticComplexity or Metrics/PerceivedComplexity
36
-
37
- # [1.0.1 - 2021-04-10]
38
- ## Fixed
39
- - Don't scan the gems directory
40
-
41
- # [1.0.0 - 2021-04-10]
42
- ## Added
43
- - Fix version of this gem, using our Rails monolith Rubocop configuration as a base