nxt_cop 2.5.0 → 2.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: d36d052009c7de1ca3318d89019cd42f7db459c9ee4b2c0dd88f2e63adc37a83
4
- data.tar.gz: 5c8b68f2cf5db256d431f1e7a37702417401b82eb017af97a71f73c0f515fc2b
3
+ metadata.gz: 7f45584695121519ec6dbc0f1d565c2463dbe829e55e7cf00df78e8f728042ee
4
+ data.tar.gz: b5a2d9c22beb2f592fc8cb1d50f04abaad093c53b8b69d3bec04a18a931068b2
5
5
  SHA512:
6
- metadata.gz: 83bf1c4ce35ca15ea3211674015ca930797974855394b65fb3fbdd059399aae5542cf34be808d587df99a981ee2bc28fecfac7c2645bb244662bad3e35428fba
7
- data.tar.gz: cf81b2893d0dfd9d8df6b4d9ff624fe16bfe70a546849fa5a0bb8a84b73f555ced914022ed452dc0e9f9ada71fcf4a9069c717a9dc3169b7d5b4241097472400
6
+ metadata.gz: 6e14374bcaa444f215a6a4b62d713666ba48553e4cc4d9660c5ecd8a3d6f957184a619a7446caad5840a2d1e9f3603f9a4533c5d2a89db165efa6275718d8cf5
7
+ data.tar.gz: 9ed42c24ab1cca574a987649c7aafe5f15931297d25fdbb4e05d628df14aa9fc299f1e1466a65eed5decfdf0c5dbb37b153ad623e65b913cf135af6b75e9cfc7
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ # v2.6.0 2025-02-26
2
+
3
+ ## What's Changed
4
+
5
+ - Moves customs cops to namespace `Rubocop::Cop::NxtCop` so they can be required directly from the application without it being part of nxt_cop's `default.yml`.
6
+
7
+ # v2.5.1 2024-06-12
8
+ ## What's Changed
9
+ - Adds rubocop-rspec_rails to `.default.yml` to restore previous functionality
10
+
1
11
  # v2.5.0 2024-06-11
2
12
  ## What's Changed
3
13
  - Relaxes the rubocop version to not pin the patch
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nxt_cop (2.5.0)
4
+ nxt_cop (2.6.0)
5
5
  rubocop (~> 1.60)
6
6
  rubocop-capybara (~> 2.21)
7
7
  rubocop-factory_bot (~> 2.26)
data/default.yml CHANGED
@@ -1,15 +1,16 @@
1
1
  require:
2
- - rubocop-factory_bot
3
- - rubocop-rails
4
- - rubocop-rspec
5
- - ./custom_cops/nxt_core/rails/use_of_rails_logger.rb
2
+ - rubocop-factory_bot
3
+ - rubocop-rails
4
+ - rubocop-rspec
5
+ - rubocop-rspec_rails
6
+ - rubocop/cop/nxt_cop/use_of_rails_logger.rb
6
7
 
7
8
  inherit_mode:
8
9
  merge:
9
10
  - Exclude
10
11
  - Include
11
12
 
12
- Rails/UseOfRailsLogger:
13
+ NxtCop/UseOfRailsLogger:
13
14
  Description: "Custom Getsafe cop to ensure the correct logger is used"
14
15
 
15
16
  AllCops:
@@ -26,7 +27,6 @@ AllCops:
26
27
  DisabledByDefault: false
27
28
  NewCops: disable # to avoid warnings. TODO: remove this setting and add new cops from the warning.
28
29
 
29
-
30
30
  Layout/ArgumentAlignment:
31
31
  EnforcedStyle: with_fixed_indentation
32
32
  Layout/ArrayAlignment:
@@ -64,35 +64,44 @@ Layout/FirstArrayElementLineBreak:
64
64
  Layout/MultilineMethodParameterLineBreaks:
65
65
  Enabled: true
66
66
 
67
+ # Lint
67
68
  Lint:
68
69
  Enabled: true
69
70
  Lint/AmbiguousBlockAssociation:
70
71
  Exclude:
71
72
  - spec/**/*
73
+ Lint/AssignmentInCondition:
74
+ Enabled: true
75
+ Lint/DuplicateHashKey:
76
+ Enabled: true
77
+ Lint/DuplicateRegexpCharacterClassElement:
78
+ Enabled: true
79
+ Lint/EmptyInPattern:
80
+ Enabled: true
81
+ Lint/IncompatibleIoSelectWithFiberScheduler:
82
+ Enabled: true
83
+ Lint/LambdaWithoutLiteralBlock:
84
+ Enabled: true
72
85
  Lint/Loop:
73
- Enabled: false
86
+ Enabled: true
74
87
  Lint/MissingSuper:
75
- Enabled: false
76
- Lint/SymbolConversion:
77
- EnforcedStyle: consistent
78
- Style/TrailingCommaInHashLiteral:
79
- Enabled: false
80
- Style/HashSyntax:
81
88
  Enabled: true
82
- EnforcedShorthandSyntax: either
83
- Security:
84
- EnabledByDefault: true
85
- Style/Semicolon:
86
- Exclude:
87
- - spec/**/*
88
- Rails/TimeZone:
89
+ Lint/NoReturnInBeginEndBlocks:
89
90
  Enabled: true
90
- Rails/Date:
91
+ Lint/NumberedParameterAssignment:
91
92
  Enabled: true
92
- RSpec:
93
- Enabled: false
94
- RSpec/Focus:
93
+ Lint/RefinementImportMethods:
95
94
  Enabled: true
95
+ Lint/RequireRelativeSelfPath:
96
+ Enabled: true
97
+ Lint/ToEnumArguments:
98
+ Enabled: true
99
+ Lint/UnexpectedBlockArity:
100
+ Enabled: true
101
+ Lint/UselessRuby2Keywords:
102
+ Enabled: true
103
+ Lint/SymbolConversion:
104
+ EnforcedStyle: consistent
96
105
  Lint/AmbiguousAssignment:
97
106
  Enabled: true
98
107
  Lint/DeprecatedConstants:
@@ -116,39 +125,15 @@ Lint/RedundantDirGlobSort:
116
125
  Lint/RequireRangeParentheses:
117
126
  Enabled: true
118
127
 
119
- # These checks are valid, but better left to programmer's discretion, as the effects of such code are harmless.
128
+ # Lint - These checks are valid, but better left to programmer's discretion, as the effects of such code are harmless.
120
129
  Lint/DuplicateBranch:
121
130
  Enabled: false
122
- Lint/DuplicateRegexpCharacterClassElement:
123
- Enabled: false
124
131
  Lint/EmptyBlock:
125
132
  Enabled: false
126
133
  Lint/EmptyClass:
127
134
  Enabled: false
128
- Lint/EmptyInPattern:
129
- Enabled: false
130
- Lint/UnexpectedBlockArity:
131
- Enabled: false
132
135
 
133
- # These code patterns are rare/nonexistent in our code, so checking for them is a waste of time
134
- Lint/IncompatibleIoSelectWithFiberScheduler:
135
- Enabled: false
136
- Lint/LambdaWithoutLiteralBlock:
137
- Enabled: false
138
- Lint/NoReturnInBeginEndBlocks: # ❌ ENABLE THIS!
139
- Enabled: false
140
- Lint/NumberedParameterAssignment:
141
- Enabled: false
142
- Lint/RefinementImportMethods:
143
- Enabled: false
144
- Lint/RequireRelativeSelfPath:
145
- Enabled: false
146
- Lint/ToEnumArguments:
147
- Enabled: false
148
- Lint/UselessRuby2Keywords:
149
- Enabled: false
150
-
151
- # Since we don't have all cops enabled by default we have to add every new cop explicitly
136
+ # Lint - Since we don't have all cops enabled by default we have to add every new cop explicitly
152
137
  Lint/DuplicateMagicComment:
153
138
  Enabled: true
154
139
  Lint/UselessRescue:
@@ -160,6 +145,25 @@ Lint/MixedCaseRange:
160
145
  Lint/RedundantRegexpQuantifiers:
161
146
  Enabled: true
162
147
 
148
+ Style/TrailingCommaInHashLiteral:
149
+ Enabled: false
150
+ Style/HashSyntax:
151
+ Enabled: true
152
+ EnforcedShorthandSyntax: either
153
+ Security:
154
+ EnabledByDefault: true
155
+ Style/Semicolon:
156
+ Exclude:
157
+ - spec/**/*
158
+ Rails/TimeZone:
159
+ Enabled: true
160
+ Rails/Date:
161
+ Enabled: true
162
+ RSpec:
163
+ Enabled: false
164
+ RSpec/Focus:
165
+ Enabled: true
166
+
163
167
  # This is default cops we want to keep disabled:
164
168
  Style/FrozenStringLiteralComment:
165
169
  Enabled: false
@@ -307,7 +311,7 @@ Rails/IndexBy:
307
311
  Enabled: false
308
312
  Rails/Pick:
309
313
  Enabled: false
310
- Style/CombinableLoops: # hard to autocorrect properly
314
+ Style/CombinableLoops: # hard to autocorrect properly
311
315
  Enabled: false
312
316
  FactoryBot/CreateList:
313
317
  Enabled: false
@@ -319,7 +323,7 @@ Style/GuardClause:
319
323
  Enabled: false
320
324
  Style/PercentLiteralDelimiters:
321
325
  Enabled: false
322
- Style/StringConcatenation: # heavily used in insurance service
326
+ Style/StringConcatenation: # heavily used in insurance service
323
327
  Enabled: false
324
328
  Style/InverseMethods:
325
329
  Enabled: false
@@ -392,7 +396,7 @@ Rails/UniqueValidationWithoutIndex: # definitely enable!!!
392
396
  Enabled: false
393
397
  Rails/Validation: # discuss with the team
394
398
  Enabled: false
395
- Rails/LexicallyScopedActionFilter: # enable and manually disable offences
399
+ Rails/LexicallyScopedActionFilter: # enable and manually disable offences
396
400
  Enabled: false
397
401
  Security/Open:
398
402
  Enabled: false
@@ -1,3 +1,3 @@
1
1
  module NxtCop
2
- VERSION = '2.5.0'.freeze
2
+ VERSION = '2.6.0'.freeze
3
3
  end
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module CustomCops
4
- module NxtCore
5
- module Rails
3
+ module Rubocop
4
+ module Cop
5
+ module NxtCop
6
6
  # Ensures that the NxtCore logger is used instead of `Rails.logger`.
7
7
  class UseOfRailsLogger < RuboCop::Cop::Base
8
8
  extend RuboCop::Cop::AutoCorrector
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'rubocop/cop/nxt_cop/use_of_rails_logger'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nxt_cop
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 2.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Livingstone
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-06-12 00:00:00.000000000 Z
11
+ date: 2025-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -172,9 +172,10 @@ files:
172
172
  - bin/guard
173
173
  - bin/rspec
174
174
  - bin/setup
175
- - custom_cops/nxt_core/rails/use_of_rails_logger.rb
176
175
  - default.yml
177
176
  - lib/nxt_cop/version.rb
177
+ - lib/rubocop/cop/nxt_cop.rb
178
+ - lib/rubocop/cop/nxt_cop/use_of_rails_logger.rb
178
179
  - nxt_cop.gemspec
179
180
  homepage: https://github.com/nxt-insurance/nxt_cop
180
181
  licenses: