simplycop 2.14.0 → 2.15.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: 4803e524b4745b70f96be0dc60b5f653b8256d0408ba5c7bcaebd6388f85a894
4
- data.tar.gz: e88c1a5708dec5eda23e8cddd1d41fab8429e62856da632294b5ecfb27eeb222
3
+ metadata.gz: 001daed63b2564e1470bfc3d10a710e539d27be6ebd1525736f715c84b15ccc2
4
+ data.tar.gz: 4ec0826610ae5b39b596ef2a420eac1812e79004b730edae051091c9e57bc80c
5
5
  SHA512:
6
- metadata.gz: 44ca9ba7109d917f7d19be1333a6ba5c9635bb481b6546b5762122d0d75ad15438d05a03b626f9cca32d00e55ceae43229db07e34bc4f6bcb4c13c6ccfb06b4e
7
- data.tar.gz: 808aa15535661dd3a06795be15172c2e7c2b924f70d85ef40a815a8600e93f70adf5de694c3418c84b34185fdb6518d9388e59622f38a6aa51f35b16d26aeacc
6
+ metadata.gz: 6d9ae17467b5944a0772b6f083c6b4f07e42e5cd792f77f60bc5aa5665ae064edb19e4c9cbaf5d9afda5968dbdaf71c71f23157fdc4a8c502b5a72f345b8db7e
7
+ data.tar.gz: 2417bd12bfdd7735997817cc82a33b0b3a9f3cc133c99e2526e614aeac288d4cb0795193218c64eeba2939788911b4580cc8d3a61cf5d6fc86a3db1a4b01e37d
@@ -1,5 +1,4 @@
1
- require:
2
- - rubocop-capybara
1
+ plugins: rubocop-capybara
3
2
 
4
3
  Capybara/AmbiguousClick:
5
4
  Enabled: true
@@ -1,5 +1,4 @@
1
- require:
2
- - rubocop-factory_bot
1
+ plugins: rubocop-factory_bot
3
2
 
4
3
  FactoryBot/AssociationStyle:
5
4
  Enabled: true
data/.simplycop_lint.yml CHANGED
@@ -54,6 +54,9 @@ Lint/ConstantReassignment:
54
54
  Lint/ConstantResolution:
55
55
  Enabled: false
56
56
 
57
+ Lint/CopDirectiveSyntax:
58
+ Enabled: true
59
+
57
60
  Lint/Debugger:
58
61
  Enabled: true
59
62
 
@@ -290,6 +293,9 @@ Lint/RedundantSplatExpansion:
290
293
  Lint/RedundantStringCoercion:
291
294
  Enabled: true
292
295
 
296
+ Lint/RedundantTypeConversion:
297
+ Enabled: true
298
+
293
299
  Lint/RedundantWithIndex:
294
300
  Enabled: true
295
301
 
@@ -357,6 +363,9 @@ Lint/StructNewOverride:
357
363
  Lint/SuppressedException:
358
364
  Enabled: true
359
365
 
366
+ Lint/SuppressedExceptionInNumberConversion:
367
+ Enabled: true
368
+
360
369
  Lint/SymbolConversion:
361
370
  Enabled: true
362
371
 
@@ -417,6 +426,9 @@ Lint/UselessAccessModifier:
417
426
  Lint/UselessAssignment:
418
427
  Enabled: true
419
428
 
429
+ Lint/UselessConstantScoping:
430
+ Enabled: true
431
+
420
432
  Lint/UselessDefined:
421
433
  Enabled: true
422
434
 
@@ -1,5 +1,4 @@
1
- require:
2
- - rubocop-performance
1
+ plugins: rubocop-performance
3
2
 
4
3
  Performance/AncestorsInclude:
5
4
  Enabled: true
data/.simplycop_rails.yml CHANGED
@@ -1,5 +1,4 @@
1
- require:
2
- - rubocop-rails
1
+ plugins: rubocop-rails
3
2
 
4
3
  # Overridden in Chopin
5
4
  Rails/ActionControllerFlashBeforeRender:
data/.simplycop_rspec.yml CHANGED
@@ -1,5 +1,4 @@
1
- require:
2
- - rubocop-rspec
1
+ plugins: rubocop-rspec
3
2
 
4
3
  RSpec/AlignLeftLetBrace:
5
4
  Enabled: false
@@ -1,5 +1,4 @@
1
- require:
2
- - rubocop-rspec_rails
1
+ plugins: rubocop-rspec_rails
3
2
 
4
3
  RSpecRails/AvoidSetupHook:
5
4
  Enabled: true
data/.simplycop_style.yml CHANGED
@@ -612,6 +612,9 @@ Style/RedundantFileExtensionInRequire:
612
612
  Style/RedundantFilterChain:
613
613
  Enabled: true
614
614
 
615
+ Style/RedundantFormat:
616
+ Enabled: true
617
+
615
618
  Style/RedundantFreeze:
616
619
  Enabled: true
617
620
 
data/catalog-info.yaml CHANGED
@@ -10,7 +10,7 @@ metadata:
10
10
  simplybusiness.com/bnw-app-name: simplycop
11
11
  simplybusiness.com/sast-scanning: enabled
12
12
  rubygems.org/name: simplycop
13
- rubygems.org/current-version: 2.14.0
13
+ rubygems.org/current-version: 2.15.1
14
14
  spec:
15
15
  type: library
16
16
  lifecycle: production
data/docs/index.md CHANGED
@@ -101,3 +101,39 @@ class BooksController < ApplicationController
101
101
  end
102
102
  ```
103
103
  Vulnerability Details: https://nvd.nist.gov/vuln/detail/CVE-2020-8159
104
+
105
+ ## Development
106
+
107
+ To change a setting for simplycop, simply edit the relevant .yml file with the configuration changes you wish to make. The aim is to choose a sensible configuration for all new cops as they are added in package updates.
108
+
109
+ Rubocop is well established enough that most new cops are for niche cases. The default assumption is therefore that they will provide a small code quality benefit without major disruption to the codebase and can safely be enabled.
110
+
111
+ However, this is not always the case. Always check the notes on the cop to understand the reasoning behind it, paying particular attention to any warnings and exceptions listed.
112
+
113
+ - [Base Rubocop](https://docs.rubocop.org/rubocop/cops.html)
114
+ - [Rubocop Capybara](https://docs.rubocop.org/rubocop-capybara/cops.html)
115
+ - [Rubocop Factory Bot](https://docs.rubocop.org/rubocop-factory_bot/cops.html)
116
+ - [Rubocop Performance](https://docs.rubocop.org/rubocop-performance/cops.html)
117
+ - [Rubocop Rails](https://docs.rubocop.org/rubocop-rails/cops.html)
118
+ - [Rubocop Rspec](https://docs.rubocop.org/rubocop-rspec/cops.html)
119
+ - [Rubocop RSpec Rails](https://docs.rubocop.org/rubocop-rspec_rails/cops.html)
120
+
121
+ Consider keeping the cop disabled (or selecting a sensible config option) if any of the following apply:
122
+ - The cop is disabled by default in rubocop (NB: All new cops are set to pending until the next major rubocop version)
123
+ - The cop is listed as not safe in rubocop. Read the notes to find out why.
124
+ - It is known that a large part of the SB codebase will systematically break a rule. Use smaller, newer repos as your benchmark for this. Chopin and Rater will have violations for most new rules, so do not disable a rule on that basis alone if it will bring benefit across the wider codebase.
125
+
126
+ Other things to bear in mind:
127
+ - Lean towards enabling rules if there are clear performance and/or clarity benefits.
128
+ - Avoid setting config or enablement based on personal stylistic preference. If a team has a particularly strong stylistic preference on, say [explicit return of nil](https://docs.rubocop.org/rubocop/cops_style.html#stylereturnnil) this can be overridden at a repo level.
129
+ - Default maximums for metrics cops are hard to meet and regularly violated. For that reason, they are mostly overridden or set as 'to-dos' within individual repos. There will be value in reducing violation of these over time, but centralised maximums have not yet been discussed or set.
130
+
131
+ If in doubt, discuss in #technical-excellence-community or #tech for guidance and a wider range of opinion.
132
+
133
+ ### Versioning
134
+
135
+ When updating simplycop, you can use [dobby](https://github.com/simplybusiness/dobby) in your PR comments to increment the version number. Try to stick to the following versioning principles
136
+
137
+ - MAJOR: For breaking changes (e.g in [v2.0](https://github.com/simplybusiness/simplycop/releases/tag/2.0.0) several rubocop departments were split out into separate packages)
138
+ - MINOR: For rule enablements, disablements and config changes (i.e. changes that may cause previously passing rubocop runs to fail)
139
+ - PATCH: For updates that do not touch config (e.g. individual rubocop package bumps which typically fix false positives/negatives or other bugs, doc changes)
@@ -7,5 +7,5 @@
7
7
  #
8
8
 
9
9
  module Simplycop
10
- VERSION = '2.14.0'
10
+ VERSION = '2.15.1'
11
11
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplycop
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.14.0
4
+ version: 2.15.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simply Business
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-03-24 00:00:00.000000000 Z
10
+ date: 2025-03-28 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rubocop