simplycop 2.19.0 → 2.20.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 +4 -4
- data/.github/workflows/ci.yml +1 -1
- data/.simplycop_gemspec.yml +3 -0
- data/.simplycop_naming.yml +1 -1
- data/.simplycop_style.yml +3 -0
- data/catalog-info.yaml +1 -1
- data/docs/index.md +342 -59
- data/lib/simplycop/version.rb +1 -1
- data/simplycop.gemspec +2 -2
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6157c3eef86dfe12f513756c99d70f0dfa29771d33ab4e8cb3e2750df0743180
|
4
|
+
data.tar.gz: bae1f7c522cde06878c7766b47fd43806018d9a9fcc4680f819776c62bcaa010
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d44d159da2e4fd39e405cd29df55071e051f13e86a7ac38bf643206f9257ef533616ce58bdd47f18daf849ddabd27e77284e0f61f240b0dfe4910a1ec6a5699
|
7
|
+
data.tar.gz: 5360a0a6bcd97ef3a524392472ed5048eb9d22fea7938fe5e8a49eae7dccbc96f0312615d2867cd8e0d4c85f5977bbf7f4bcf8a089ca6fe6834bab3c65f9ca79
|
data/.github/workflows/ci.yml
CHANGED
data/.simplycop_gemspec.yml
CHANGED
data/.simplycop_naming.yml
CHANGED
data/.simplycop_style.yml
CHANGED
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.
|
13
|
+
rubygems.org/current-version: 2.20.1
|
14
14
|
spec:
|
15
15
|
type: library
|
16
16
|
lifecycle: production
|
data/docs/index.md
CHANGED
@@ -2,20 +2,47 @@
|
|
2
2
|
|
3
3
|
Provides standard shared rubocop configuration for Simply Business applications. No more copying `.rubocop.yml`, no more out-of-sync configuration files. Yay!
|
4
4
|
|
5
|
+
## Table of Contents
|
6
|
+
|
7
|
+
- [Installation](#installation)
|
8
|
+
- [Prerequisites](#prerequisites)
|
9
|
+
- [Basic Setup](#basic-setup)
|
10
|
+
- [Configuration Examples](#configuration-examples)
|
11
|
+
- [Usage](#usage)
|
12
|
+
- [Running RuboCop](#running-rubocop)
|
13
|
+
- [CI/CD Integration](#cicd-integration)
|
14
|
+
- [Configuration Guidelines](#configuration-guidelines)
|
15
|
+
- [Non-Rails Projects](#non-rails-projects)
|
16
|
+
- [Legacy Projects](#legacy-projects)
|
17
|
+
- [Security Cops](#security-cops)
|
18
|
+
- [Development](#development)
|
19
|
+
- [Contributing Guidelines](#contributing-guidelines)
|
20
|
+
- [Testing Configuration Changes](#testing-configuration-changes)
|
21
|
+
- [Versioning](#versioning)
|
22
|
+
- [FAQ](#faq)
|
23
|
+
- [Migration Guide](#migration-guide)
|
24
|
+
|
5
25
|
## Installation
|
6
26
|
|
7
|
-
|
27
|
+
### Prerequisites
|
28
|
+
|
29
|
+
- Ruby 3.2 or higher
|
30
|
+
- Bundler
|
31
|
+
- RuboCop gem (automatically installed as a dependency)
|
32
|
+
|
33
|
+
### Basic Setup
|
8
34
|
|
9
|
-
|
10
|
-
gem 'simplycop'
|
35
|
+
Add this line to your application's Gemfile via bundle add:
|
11
36
|
|
37
|
+
```
|
38
|
+
bundle add 'simplycop'
|
12
39
|
```
|
13
40
|
|
14
41
|
Then install gems by executing:
|
15
42
|
|
16
43
|
$ bundle install
|
17
44
|
|
18
|
-
|
45
|
+
Create or update your `.rubocop.yml` file with the following basic configuration:
|
19
46
|
|
20
47
|
```yaml
|
21
48
|
inherit_gem:
|
@@ -24,9 +51,87 @@ inherit_gem:
|
|
24
51
|
AllCops:
|
25
52
|
Exclude:
|
26
53
|
- 'vendor/**/*'
|
54
|
+
- 'db/schema.rb'
|
55
|
+
- 'node_modules/**/*'
|
56
|
+
```
|
57
|
+
|
58
|
+
### Configuration Examples
|
59
|
+
|
60
|
+
#### Basic Rails Application with RSpec
|
61
|
+
|
62
|
+
```yaml
|
63
|
+
inherit_gem:
|
64
|
+
simplycop:
|
65
|
+
- .simplycop.yml
|
66
|
+
- .simplycop_performance.yml
|
67
|
+
- .simplycop_rails.yml
|
68
|
+
- .simplycop_rspec.yml
|
69
|
+
|
70
|
+
AllCops:
|
71
|
+
Exclude:
|
72
|
+
- 'vendor/**/*'
|
73
|
+
- 'db/schema.rb'
|
74
|
+
- 'bin/**/*'
|
27
75
|
```
|
28
76
|
|
29
|
-
|
77
|
+
#### Rails Application with Full Test Suite
|
78
|
+
|
79
|
+
```yaml
|
80
|
+
inherit_gem:
|
81
|
+
simplycop:
|
82
|
+
- .simplycop.yml
|
83
|
+
- .simplycop_performance.yml
|
84
|
+
- .simplycop_rails.yml
|
85
|
+
- .simplycop_rspec.yml
|
86
|
+
- .simplycop_capybara.yml
|
87
|
+
- .simplycop_factory_bot.yml
|
88
|
+
- .simplycop_rspec_rails.yml
|
89
|
+
|
90
|
+
AllCops:
|
91
|
+
Exclude:
|
92
|
+
- 'vendor/**/*'
|
93
|
+
- 'db/schema.rb'
|
94
|
+
- 'bin/**/*'
|
95
|
+
```
|
96
|
+
|
97
|
+
#### Non-Rails Ruby Gem
|
98
|
+
|
99
|
+
```yaml
|
100
|
+
inherit_gem:
|
101
|
+
simplycop: .simplycop.yml
|
102
|
+
|
103
|
+
AllCops:
|
104
|
+
Exclude:
|
105
|
+
- 'vendor/**/*'
|
106
|
+
|
107
|
+
Rails:
|
108
|
+
Enabled: false
|
109
|
+
```
|
110
|
+
|
111
|
+
#### Legacy Project (Gradual Migration)
|
112
|
+
|
113
|
+
```yaml
|
114
|
+
inherit_gem:
|
115
|
+
simplycop: .simplycop.yml
|
116
|
+
|
117
|
+
AllCops:
|
118
|
+
Exclude:
|
119
|
+
- 'vendor/**/*'
|
120
|
+
- 'legacy/**/*' # Exclude legacy code initially
|
121
|
+
NewCops: disable # Don't enable new cops automatically
|
122
|
+
|
123
|
+
# Start with just a few departments
|
124
|
+
Style:
|
125
|
+
Enabled: true
|
126
|
+
Layout:
|
127
|
+
Enabled: true
|
128
|
+
Lint:
|
129
|
+
Enabled: true
|
130
|
+
```
|
131
|
+
|
132
|
+
### Available Configurations
|
133
|
+
|
134
|
+
The base `.simplycop.yml` contains cops for all the standard rubocop departments:
|
30
135
|
|
31
136
|
* Bundler
|
32
137
|
* Gemspec
|
@@ -39,101 +144,279 @@ The base `.simplycop.yml` contains cops for all the standard rubocop departments
|
|
39
144
|
* Style
|
40
145
|
|
41
146
|
These can also be enabled individually as follows:
|
147
|
+
|
42
148
|
```yaml
|
43
149
|
inherit_gem:
|
44
150
|
simplycop:
|
45
151
|
- .simplycop_<DEPARTMENT_NAME>.yml
|
46
152
|
```
|
47
153
|
|
48
|
-
|
154
|
+
**Note:** Replace `<DEPARTMENT_NAME>` with the lowercase department name (e.g., `style`, `layout`, `lint`).
|
49
155
|
|
50
|
-
|
51
|
-
inherit_gem:
|
52
|
-
simplycop:
|
53
|
-
- .simplycop.yml
|
54
|
-
- .simplycop_performance.yml
|
55
|
-
- .simplycop_rails.yml
|
56
|
-
- .simplycop_rspec.yml
|
57
|
-
```
|
156
|
+
### Additional Packages
|
58
157
|
|
59
|
-
|
158
|
+
For Rails projects with testing frameworks, you may want to include:
|
60
159
|
```yaml
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
- .simplycop_rspec_rails.yml
|
160
|
+
- .simplycop_capybara.yml # For Capybara feature tests
|
161
|
+
- .simplycop_factory_bot.yml # For FactoryBot test factories
|
162
|
+
- .simplycop_rspec_rails.yml # For RSpec Rails-specific cops
|
65
163
|
```
|
66
164
|
|
67
|
-
|
165
|
+
> **Important:** Capybara, FactoryBot and RSpecRails cops were previously available either via departments within `rubocop_rspec` or as packages in their own right. As of `rubocop_rspec` v3, they no longer exist as departments within `rubocop_rspec` and the packages need installing independently. If you use simplycop v1, you will still have access to some of these cops by inheriting `.simplycop_rspec`. As of simplycop v2 (which uses `rubocop_rspec` v3) you would need to inherit the packages individually.
|
68
166
|
|
69
167
|
## Usage
|
70
168
|
|
71
|
-
|
169
|
+
### Running RuboCop
|
170
|
+
|
171
|
+
Run RuboCop as you would usually do:
|
72
172
|
|
73
|
-
|
173
|
+
```bash
|
174
|
+
# Run on entire codebase
|
175
|
+
$ bundle exec rubocop
|
74
176
|
|
75
|
-
|
177
|
+
# Run with auto-correction
|
178
|
+
$ bundle exec rubocop --auto-correct
|
76
179
|
|
77
|
-
|
180
|
+
# Run only safe auto-corrections
|
181
|
+
$ bundle exec rubocop --safe-auto-correct
|
182
|
+
|
183
|
+
# Run on specific files or directories
|
184
|
+
$ bundle exec rubocop app/ spec/
|
185
|
+
|
186
|
+
# Generate TODO configuration for existing violations
|
187
|
+
$ bundle exec rubocop --auto-gen-config
|
188
|
+
```
|
189
|
+
|
190
|
+
### CI/CD Integration
|
191
|
+
|
192
|
+
#### GitHub Actions
|
78
193
|
|
79
|
-
* If you are implementing this in a non-rails project, you probably don't want or need the rails cops. In case they cause problems, you can exclude them using:
|
80
194
|
```yaml
|
81
|
-
|
82
|
-
|
195
|
+
name: RuboCop
|
196
|
+
on: [push, pull_request]
|
197
|
+
jobs:
|
198
|
+
rubocop:
|
199
|
+
runs-on: ubuntu-latest
|
200
|
+
steps:
|
201
|
+
- uses: actions/checkout@v4
|
202
|
+
- uses: ruby/setup-ruby@v1
|
203
|
+
with:
|
204
|
+
bundler-cache: true
|
205
|
+
- run: bundle exec rubocop
|
206
|
+
```
|
207
|
+
|
208
|
+
#### Semaphore CI
|
209
|
+
|
210
|
+
```yaml
|
211
|
+
version: v1.0
|
212
|
+
name: RuboCop
|
213
|
+
agent:
|
214
|
+
machine:
|
215
|
+
type: f1-standard-2
|
216
|
+
os_image: ubuntu2204
|
217
|
+
|
218
|
+
blocks:
|
219
|
+
- name: "RuboCop"
|
220
|
+
task:
|
221
|
+
jobs:
|
222
|
+
- name: Run RuboCop
|
223
|
+
commands:
|
224
|
+
- checkout
|
225
|
+
- cache restore
|
226
|
+
- bundle install --deployment --path vendor/bundle
|
227
|
+
- cache store
|
228
|
+
- bundle exec rubocop
|
229
|
+
prologue:
|
230
|
+
commands:
|
231
|
+
- sem-version ruby 3.2
|
83
232
|
```
|
84
|
-
* When adding rubocop and simplycop to a legacy project, you might want to initially disable some of the rules.
|
85
233
|
|
86
|
-
##
|
87
|
-
|
234
|
+
## Configuration Guidelines
|
235
|
+
|
236
|
+
### Legacy Projects
|
88
237
|
|
89
|
-
|
90
|
-
Its purpose is to raise an awareness of the finding.
|
91
|
-
When an offence was raised, please seek for help and guidance from application security team.
|
238
|
+
When adding RuboCop and simplycop to a legacy project, you might want to initially disable some of the rules. Consider this approach:
|
92
239
|
|
93
|
-
|
94
|
-
|
240
|
+
1. **Start with basic cops**: Enable only `Style`, `Layout`, and `Lint` departments initially
|
241
|
+
2. **Generate TODO configuration**: Use `--auto-gen-config` to create a `.rubocop_todo.yml` for existing violations
|
242
|
+
3. **Gradual migration**: Enable more departments over time as you clean up the codebase
|
243
|
+
4. **Team agreement**: Ensure the team agrees on the migration timeline
|
95
244
|
|
96
|
-
Example
|
245
|
+
Example for legacy projects:
|
97
246
|
|
98
|
-
```
|
99
|
-
|
100
|
-
|
101
|
-
|
247
|
+
```yaml
|
248
|
+
inherit_gem:
|
249
|
+
simplycop: .simplycop.yml
|
250
|
+
inherit_from: .rubocop_todo.yml
|
251
|
+
|
252
|
+
AllCops:
|
253
|
+
NewCops: disable # Don't enable new cops automatically
|
254
|
+
Exclude:
|
255
|
+
- 'vendor/**/*'
|
256
|
+
- 'legacy_code/**/*' # Exclude problematic areas initially
|
102
257
|
```
|
103
|
-
Vulnerability Details: https://nvd.nist.gov/vuln/detail/CVE-2020-8159
|
104
258
|
|
105
259
|
## Development
|
106
260
|
|
107
|
-
|
261
|
+
### Contributing Guidelines
|
108
262
|
|
109
|
-
|
263
|
+
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.
|
264
|
+
|
265
|
+
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
266
|
|
111
267
|
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
268
|
|
113
|
-
|
114
|
-
|
115
|
-
- [
|
116
|
-
- [
|
117
|
-
- [
|
118
|
-
- [
|
119
|
-
- [
|
269
|
+
#### Useful References
|
270
|
+
|
271
|
+
- [Base RuboCop](https://docs.rubocop.org/rubocop/cops.html)
|
272
|
+
- [RuboCop Capybara](https://docs.rubocop.org/rubocop-capybara/cops.html)
|
273
|
+
- [RuboCop Factory Bot](https://docs.rubocop.org/rubocop-factory_bot/cops.html)
|
274
|
+
- [RuboCop Performance](https://docs.rubocop.org/rubocop-performance/cops.html)
|
275
|
+
- [RuboCop Rails](https://docs.rubocop.org/rubocop-rails/cops.html)
|
276
|
+
- [RuboCop RSpec](https://docs.rubocop.org/rubocop-rspec/cops.html)
|
277
|
+
- [RuboCop RSpec Rails](https://docs.rubocop.org/rubocop-rspec_rails/cops.html)
|
278
|
+
|
279
|
+
#### When to Keep a Cop Disabled
|
120
280
|
|
121
281
|
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
282
|
|
126
|
-
|
127
|
-
-
|
128
|
-
-
|
129
|
-
|
283
|
+
- The cop is disabled by default in RuboCop (Note: All new cops are set to pending until the next major RuboCop version)
|
284
|
+
- The cop is listed as not safe in RuboCop. Read the notes to find out why
|
285
|
+
- 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
|
286
|
+
|
287
|
+
#### Decision-Making Guidelines
|
288
|
+
|
289
|
+
- Lean towards enabling rules if there are clear performance and/or clarity benefits
|
290
|
+
- 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
|
291
|
+
- 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 centralized maximums have not yet been discussed or set
|
292
|
+
|
293
|
+
If in doubt, discuss in `#technical-excellence-community` or `#tech` for guidance and a wider range of opinion.
|
294
|
+
|
295
|
+
### Testing Configuration Changes
|
296
|
+
|
297
|
+
Before submitting changes to simplycop configurations:
|
130
298
|
|
131
|
-
|
299
|
+
1. **Test locally**: Apply your changes to a sample project and run RuboCop
|
300
|
+
2. **Check multiple projects**: Test on both new and legacy codebases if possible
|
301
|
+
3. **Review impact**: Consider how many violations the change might introduce
|
302
|
+
4. **Document rationale**: Include reasoning for the change in your PR description
|
303
|
+
|
304
|
+
Example testing workflow:
|
305
|
+
|
306
|
+
```bash
|
307
|
+
# In a test project
|
308
|
+
echo "inherit_gem:\n simplycop: .simplycop.yml" > .rubocop.yml
|
309
|
+
bundle add simplycop --path="/path/to/your/local/simplycop"
|
310
|
+
bundle exec rubocop --dry-run
|
311
|
+
```
|
132
312
|
|
133
313
|
### Versioning
|
134
314
|
|
135
|
-
|
315
|
+
#### Automatic Versioning
|
316
|
+
|
317
|
+
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
318
|
|
137
319
|
- 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
320
|
- MINOR: For rule enablements, disablements and config changes (i.e. changes that may cause previously passing rubocop runs to fail)
|
139
321
|
- 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)
|
322
|
+
|
323
|
+
#### Manual Versioning
|
324
|
+
|
325
|
+
If you prefer to manually version, you can do so by editing the `lib/simplycop/version.rb` file and updating the `VERSION` line and updating the `catalog-info.yaml` file with the new version number for the annotation `rubygems.org/current-version`.
|
326
|
+
|
327
|
+
## FAQ
|
328
|
+
|
329
|
+
### Common Questions
|
330
|
+
|
331
|
+
**Q: Can I override specific cops in my project?**
|
332
|
+
A: Yes, you can override any cop configuration in your local `.rubocop.yml` file. Your local configuration takes precedence over inherited configurations.
|
333
|
+
|
334
|
+
**Q: How do I handle RuboCop violations in legacy code?**
|
335
|
+
A: Use `bundle exec rubocop --auto-gen-config` to generate a `.rubocop_todo.yml` file that disables existing violations. Then gradually address violations over time.
|
336
|
+
|
337
|
+
**Q: What's the difference between simplycop v1 and v2?**
|
338
|
+
A: v2 uses RuboCop RSpec v3, which splits Capybara, FactoryBot, and RSpecRails cops into separate packages. You'll need to explicitly include these configurations if you use them.
|
339
|
+
|
340
|
+
**Q: Can I use simplycop with other RuboCop configurations?**
|
341
|
+
A: Yes, you can inherit from multiple sources. List simplycop first to establish the base, then add other configurations.
|
342
|
+
|
343
|
+
**Q: How often is simplycop updated?**
|
344
|
+
A: Simplycop is updated regularly to include new RuboCop cops and configuration improvements. Check the [releases page](https://github.com/simplybusiness/simplycop/releases) for updates.
|
345
|
+
|
346
|
+
**Q: What if a new cop causes too many violations?**
|
347
|
+
A: New cops are carefully evaluated before being enabled. If you encounter issues, discuss with the team in `#technical-excellence-community` or create an issue on the simplycop repository.
|
348
|
+
|
349
|
+
### Troubleshooting
|
350
|
+
|
351
|
+
**RuboCop exits with "undefined method" errors:**
|
352
|
+
- Ensure you're using compatible versions of RuboCop and simplycop
|
353
|
+
- Try running `bundle update` to update dependencies
|
354
|
+
|
355
|
+
**Unexpected violations after updating simplycop:**
|
356
|
+
- Check the changelog for new enabled cops
|
357
|
+
- Use `--auto-gen-config` to temporarily disable new violations while you address them
|
358
|
+
|
359
|
+
**Performance issues with large codebases:**
|
360
|
+
- Use `.rubocop.yml` exclude patterns to skip large generated files
|
361
|
+
- Consider running RuboCop on specific directories during development
|
362
|
+
|
363
|
+
## Migration Guide
|
364
|
+
|
365
|
+
### From Standard RuboCop Configuration
|
366
|
+
|
367
|
+
If you're currently using a custom `.rubocop.yml` file:
|
368
|
+
|
369
|
+
1. **Back up your current configuration**:
|
370
|
+
```bash
|
371
|
+
cp .rubocop.yml .rubocop.yml.backup
|
372
|
+
```
|
373
|
+
|
374
|
+
2. **Create a new minimal configuration**:
|
375
|
+
```yaml
|
376
|
+
inherit_gem:
|
377
|
+
simplycop: .simplycop.yml
|
378
|
+
|
379
|
+
AllCops:
|
380
|
+
Exclude:
|
381
|
+
- 'vendor/**/*'
|
382
|
+
```
|
383
|
+
|
384
|
+
3. **Add your project-specific overrides**:
|
385
|
+
- Review your backup configuration
|
386
|
+
- Add any project-specific cop configurations to your new `.rubocop.yml`
|
387
|
+
- Test thoroughly before committing
|
388
|
+
|
389
|
+
### From Other Shared Configurations
|
390
|
+
|
391
|
+
If you're migrating from another shared RuboCop configuration:
|
392
|
+
|
393
|
+
1. **Identify differences**: Compare your current configuration with simplycop's defaults
|
394
|
+
2. **Plan the migration**: Decide whether to adopt simplycop's settings or override them
|
395
|
+
3. **Test incrementally**: Apply changes in small batches to understand the impact
|
396
|
+
4. **Update CI/CD**: Ensure your continuous integration tools use the new configuration
|
397
|
+
|
398
|
+
### From Simplycop v1 to v2
|
399
|
+
|
400
|
+
Key changes in v2:
|
401
|
+
- Uses RuboCop RSpec v3
|
402
|
+
- Capybara, FactoryBot, and RSpecRails cops are now separate packages
|
403
|
+
- Some cop names and configurations may have changed
|
404
|
+
|
405
|
+
Migration steps:
|
406
|
+
1. **Update your Gemfile**: Ensure you're using simplycop v2
|
407
|
+
2. **Update your configuration**: If you use RSpec testing cops, explicitly include the new packages:
|
408
|
+
```yaml
|
409
|
+
inherit_gem:
|
410
|
+
simplycop:
|
411
|
+
- .simplycop.yml
|
412
|
+
- .simplycop_rspec.yml
|
413
|
+
- .simplycop_capybara.yml # Add if you use Capybara
|
414
|
+
- .simplycop_factory_bot.yml # Add if you use FactoryBot
|
415
|
+
- .simplycop_rspec_rails.yml # Add if you use RSpec Rails
|
416
|
+
```
|
417
|
+
3. **Test thoroughly**: Run RuboCop and address any new or changed violations
|
418
|
+
4. **Update documentation**: Ensure your team is aware of the changes
|
419
|
+
|
420
|
+
---
|
421
|
+
|
422
|
+
For more information, visit the [simplycop repository](https://github.com/simplybusiness/simplycop) or reach out to the team in `#technical-excellence-community`.
|
data/lib/simplycop/version.rb
CHANGED
data/simplycop.gemspec
CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.version = Simplycop::VERSION
|
10
10
|
spec.authors = ['Simply Business']
|
11
11
|
spec.email = ['tech@simplybusiness.co.uk']
|
12
|
-
spec.required_ruby_version = ['>= 3.
|
12
|
+
spec.required_ruby_version = ['>= 3.2 ', '< 3.5']
|
13
13
|
spec.license = 'MIT'
|
14
14
|
spec.summary = 'Provides a single point of reference for common rubocop rules.'
|
15
15
|
spec.description = 'Require this gem in your application to use Simply Business common rubocop rules.'
|
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
18
|
spec.require_paths = ['lib']
|
19
19
|
|
20
|
-
spec.add_dependency 'rubocop', '1.
|
20
|
+
spec.add_dependency 'rubocop', '1.77.0'
|
21
21
|
spec.add_dependency 'rubocop-ast', '1.45.1'
|
22
22
|
spec.add_dependency 'rubocop-capybara', '2.22.1'
|
23
23
|
spec.add_dependency 'rubocop-factory_bot', '2.27.1'
|
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.
|
4
|
+
version: 2.20.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simply Business
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-07-07 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: rubocop
|
@@ -15,14 +15,14 @@ dependencies:
|
|
15
15
|
requirements:
|
16
16
|
- - '='
|
17
17
|
- !ruby/object:Gem::Version
|
18
|
-
version: 1.
|
18
|
+
version: 1.77.0
|
19
19
|
type: :runtime
|
20
20
|
prerelease: false
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
22
22
|
requirements:
|
23
23
|
- - '='
|
24
24
|
- !ruby/object:Gem::Version
|
25
|
-
version: 1.
|
25
|
+
version: 1.77.0
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: rubocop-ast
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
@@ -239,7 +239,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
239
239
|
requirements:
|
240
240
|
- - ">="
|
241
241
|
- !ruby/object:Gem::Version
|
242
|
-
version: '3.
|
242
|
+
version: '3.2'
|
243
243
|
- - "<"
|
244
244
|
- !ruby/object:Gem::Version
|
245
245
|
version: '3.5'
|