nxt_cop 2.5.1 → 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: 37e3e6ce44d270ed989ace3bdbe47d00a77d0d176decb7cdb3c7370a20794b2a
4
- data.tar.gz: 1f8697b0a0292a3e54a4c68b7fc95bfda02d9927be3595e05e0d2b579c41feb5
3
+ metadata.gz: 7f45584695121519ec6dbc0f1d565c2463dbe829e55e7cf00df78e8f728042ee
4
+ data.tar.gz: b5a2d9c22beb2f592fc8cb1d50f04abaad093c53b8b69d3bec04a18a931068b2
5
5
  SHA512:
6
- metadata.gz: 27b559ee3b7e857065ea5a71f2c0ccdeab9ba9fc515fc0ee3ec48823d1526c39012d707f4a2410afbe7c603cb7d15ff013e3c3f823c0db07afc8b5d8b60def00
7
- data.tar.gz: cc093f2b2857318ac0550999b35c0883070a47d2e8667591db59f029d5229c7cf74e74628e208ae47ecdeafdd8a7967fcabc8718858037d58be1846451d58364
6
+ metadata.gz: 6e14374bcaa444f215a6a4b62d713666ba48553e4cc4d9660c5ecd8a3d6f957184a619a7446caad5840a2d1e9f3603f9a4533c5d2a89db165efa6275718d8cf5
7
+ data.tar.gz: 9ed42c24ab1cca574a987649c7aafe5f15931297d25fdbb4e05d628df14aa9fc299f1e1466a65eed5decfdf0c5dbb37b153ad623e65b913cf135af6b75e9cfc7
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
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
+
1
7
  # v2.5.1 2024-06-12
2
8
  ## What's Changed
3
9
  - Adds rubocop-rspec_rails to `.default.yml` to restore previous functionality
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nxt_cop (2.5.1)
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,16 +1,16 @@
1
1
  require:
2
- - rubocop-factory_bot
3
- - rubocop-rails
4
- - rubocop-rspec
5
- - rubocop-rspec_rails
6
- - ./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
7
7
 
8
8
  inherit_mode:
9
9
  merge:
10
10
  - Exclude
11
11
  - Include
12
12
 
13
- Rails/UseOfRailsLogger:
13
+ NxtCop/UseOfRailsLogger:
14
14
  Description: "Custom Getsafe cop to ensure the correct logger is used"
15
15
 
16
16
  AllCops:
@@ -27,7 +27,6 @@ AllCops:
27
27
  DisabledByDefault: false
28
28
  NewCops: disable # to avoid warnings. TODO: remove this setting and add new cops from the warning.
29
29
 
30
-
31
30
  Layout/ArgumentAlignment:
32
31
  EnforcedStyle: with_fixed_indentation
33
32
  Layout/ArrayAlignment:
@@ -65,35 +64,44 @@ Layout/FirstArrayElementLineBreak:
65
64
  Layout/MultilineMethodParameterLineBreaks:
66
65
  Enabled: true
67
66
 
67
+ # Lint
68
68
  Lint:
69
69
  Enabled: true
70
70
  Lint/AmbiguousBlockAssociation:
71
71
  Exclude:
72
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
73
85
  Lint/Loop:
74
- Enabled: false
86
+ Enabled: true
75
87
  Lint/MissingSuper:
76
- Enabled: false
77
- Lint/SymbolConversion:
78
- EnforcedStyle: consistent
79
- Style/TrailingCommaInHashLiteral:
80
- Enabled: false
81
- Style/HashSyntax:
82
88
  Enabled: true
83
- EnforcedShorthandSyntax: either
84
- Security:
85
- EnabledByDefault: true
86
- Style/Semicolon:
87
- Exclude:
88
- - spec/**/*
89
- Rails/TimeZone:
89
+ Lint/NoReturnInBeginEndBlocks:
90
90
  Enabled: true
91
- Rails/Date:
91
+ Lint/NumberedParameterAssignment:
92
92
  Enabled: true
93
- RSpec:
94
- Enabled: false
95
- RSpec/Focus:
93
+ Lint/RefinementImportMethods:
96
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
97
105
  Lint/AmbiguousAssignment:
98
106
  Enabled: true
99
107
  Lint/DeprecatedConstants:
@@ -117,39 +125,15 @@ Lint/RedundantDirGlobSort:
117
125
  Lint/RequireRangeParentheses:
118
126
  Enabled: true
119
127
 
120
- # 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.
121
129
  Lint/DuplicateBranch:
122
130
  Enabled: false
123
- Lint/DuplicateRegexpCharacterClassElement:
124
- Enabled: false
125
131
  Lint/EmptyBlock:
126
132
  Enabled: false
127
133
  Lint/EmptyClass:
128
134
  Enabled: false
129
- Lint/EmptyInPattern:
130
- Enabled: false
131
- Lint/UnexpectedBlockArity:
132
- Enabled: false
133
135
 
134
- # These code patterns are rare/nonexistent in our code, so checking for them is a waste of time
135
- Lint/IncompatibleIoSelectWithFiberScheduler:
136
- Enabled: false
137
- Lint/LambdaWithoutLiteralBlock:
138
- Enabled: false
139
- Lint/NoReturnInBeginEndBlocks: # ❌ ENABLE THIS!
140
- Enabled: false
141
- Lint/NumberedParameterAssignment:
142
- Enabled: false
143
- Lint/RefinementImportMethods:
144
- Enabled: false
145
- Lint/RequireRelativeSelfPath:
146
- Enabled: false
147
- Lint/ToEnumArguments:
148
- Enabled: false
149
- Lint/UselessRuby2Keywords:
150
- Enabled: false
151
-
152
- # 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
153
137
  Lint/DuplicateMagicComment:
154
138
  Enabled: true
155
139
  Lint/UselessRescue:
@@ -161,6 +145,25 @@ Lint/MixedCaseRange:
161
145
  Lint/RedundantRegexpQuantifiers:
162
146
  Enabled: true
163
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
+
164
167
  # This is default cops we want to keep disabled:
165
168
  Style/FrozenStringLiteralComment:
166
169
  Enabled: false
@@ -308,7 +311,7 @@ Rails/IndexBy:
308
311
  Enabled: false
309
312
  Rails/Pick:
310
313
  Enabled: false
311
- Style/CombinableLoops: # hard to autocorrect properly
314
+ Style/CombinableLoops: # hard to autocorrect properly
312
315
  Enabled: false
313
316
  FactoryBot/CreateList:
314
317
  Enabled: false
@@ -320,7 +323,7 @@ Style/GuardClause:
320
323
  Enabled: false
321
324
  Style/PercentLiteralDelimiters:
322
325
  Enabled: false
323
- Style/StringConcatenation: # heavily used in insurance service
326
+ Style/StringConcatenation: # heavily used in insurance service
324
327
  Enabled: false
325
328
  Style/InverseMethods:
326
329
  Enabled: false
@@ -393,7 +396,7 @@ Rails/UniqueValidationWithoutIndex: # definitely enable!!!
393
396
  Enabled: false
394
397
  Rails/Validation: # discuss with the team
395
398
  Enabled: false
396
- Rails/LexicallyScopedActionFilter: # enable and manually disable offences
399
+ Rails/LexicallyScopedActionFilter: # enable and manually disable offences
397
400
  Enabled: false
398
401
  Security/Open:
399
402
  Enabled: false
@@ -1,3 +1,3 @@
1
1
  module NxtCop
2
- VERSION = '2.5.1'.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.1
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: