rubocop-govuk 0.1.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +25 -0
- data/README.md +15 -2
- data/config/{all.yml → default.yml} +4 -3
- data/config/gds-ruby-styleguide.yml +5 -5
- data/config/other-excludes.yml +3 -0
- data/config/other-lint.yml +1 -1
- data/config/other-style.yml +4 -8
- data/config/{other-rails.yml → rails.yml} +8 -1
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c985f0a7349aa6c850b6bd513842493da5f81e61591eedcf9cf4ce9d380fa8b9
|
4
|
+
data.tar.gz: ef566e0f80e0370ebec6e7fc1ee067d4fc14c098197ea9b0785b9fc100c196bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5a787cce9b118ce1198c3d22ab475219098a9f52f6199777ca26278951ea7e5b975b26ac4a344f7c2f0a67f187d3794358cfc520600fdf0512fadbaf6d5a7ca
|
7
|
+
data.tar.gz: f6bdfd64f7c72676934547775707132425480acebb0fcc71174830eb29d1c170fc5e4a3e42d548f5916a9bd900db3e36f4e02326d9ae9f99b7dfe62bf72a7245
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,28 @@
|
|
1
|
+
# 3.1.0
|
2
|
+
|
3
|
+
* Fix deprecation warning for AllCops/Excludes => AllCops/Exclude (#17)
|
4
|
+
* Exclude `config.ru` from linter checks (#18)
|
5
|
+
|
6
|
+
# 3.0.0
|
7
|
+
|
8
|
+
* Update Rubocop to 0.80.1
|
9
|
+
* This deletes the Style/BracesAroundHashParameters cop for future
|
10
|
+
Ruby 3 compatibility.
|
11
|
+
* Exclude `bin` directory and `db/schema.rb` from linter checks (#14)
|
12
|
+
|
13
|
+
# 2.0.0
|
14
|
+
|
15
|
+
* Use specific version for RuboCop
|
16
|
+
* Update RuboCop to 0.77
|
17
|
+
|
18
|
+
# 1.0.0
|
19
|
+
|
20
|
+
* Allow importing of Ruby and Rails rules seperately
|
21
|
+
|
22
|
+
# 0.2.0
|
23
|
+
|
24
|
+
* Disable the Style/FormatStringToken cop
|
25
|
+
|
1
26
|
# 0.1.0
|
2
27
|
|
3
28
|
* Initial release with previous work from `govuk-lint`
|
data/README.md
CHANGED
@@ -5,16 +5,29 @@ This repository provides common RuboCop rules for use with GOV.UK Ruby projects
|
|
5
5
|
## Installation
|
6
6
|
|
7
7
|
Add `rubocop-govuk` to your Gemfile and then run `bundle install`:
|
8
|
+
|
8
9
|
```ruby
|
9
10
|
# Gemfile
|
10
11
|
gem 'rubocop-govuk'
|
11
12
|
```
|
12
13
|
|
13
14
|
Inherit rules from the gem by adding the following to your project's RuboCop config:
|
15
|
+
|
16
|
+
```yaml
|
17
|
+
# .rubocop.yml
|
18
|
+
inherit_gem:
|
19
|
+
rubocop-govuk:
|
20
|
+
- config/default.yml
|
21
|
+
```
|
22
|
+
|
23
|
+
or if you also need Rails specific rules:
|
24
|
+
|
14
25
|
```yaml
|
15
|
-
# .rubocop
|
26
|
+
# .rubocop.yml
|
16
27
|
inherit_gem:
|
17
|
-
rubocop-govuk:
|
28
|
+
rubocop-govuk:
|
29
|
+
- config/default.yml
|
30
|
+
- config/rails.yml
|
18
31
|
```
|
19
32
|
|
20
33
|
## Usage
|
@@ -1,4 +1,8 @@
|
|
1
1
|
AllCops:
|
2
|
+
Exclude:
|
3
|
+
- 'bin/**'
|
4
|
+
- 'config.ru'
|
5
|
+
|
2
6
|
DisplayCopNames:
|
3
7
|
Description: 'Display cop names in offense messages'
|
4
8
|
Enabled: true
|
@@ -11,12 +15,9 @@ AllCops:
|
|
11
15
|
Description: 'Display style guide URLs in offense messages.'
|
12
16
|
Enabled: true
|
13
17
|
|
14
|
-
require: rubocop-rails
|
15
|
-
|
16
18
|
inherit_from:
|
17
19
|
- gds-ruby-styleguide.yml
|
18
20
|
- other-lint.yml
|
19
|
-
- other-rails.yml
|
20
21
|
- other-style.yml
|
21
22
|
- other-metrics.yml
|
22
23
|
- other-excludes.yml
|
@@ -55,7 +55,7 @@ Layout/IndentationConsistency:
|
|
55
55
|
Description: Keep indentation straight.
|
56
56
|
Enabled: true
|
57
57
|
|
58
|
-
|
58
|
+
Layout/LineLength:
|
59
59
|
Description: Limit lines to 80 characters.
|
60
60
|
Enabled: false
|
61
61
|
Max: 80
|
@@ -114,7 +114,7 @@ Layout/TrailingWhitespace:
|
|
114
114
|
Enabled: true
|
115
115
|
|
116
116
|
# Supports --auto-correct
|
117
|
-
Layout/
|
117
|
+
Layout/TrailingEmptyLines:
|
118
118
|
Description: Checks trailing blank lines and final newline.
|
119
119
|
Enabled: true
|
120
120
|
EnforcedStyle: final_newline
|
@@ -245,7 +245,7 @@ Style/TrivialAccessors:
|
|
245
245
|
ExactNameMatch: true
|
246
246
|
AllowPredicates: true
|
247
247
|
AllowDSLWriters: false
|
248
|
-
|
248
|
+
AllowedMethods:
|
249
249
|
- to_ary
|
250
250
|
- to_a
|
251
251
|
- to_c
|
@@ -282,7 +282,7 @@ Lint/RescueException:
|
|
282
282
|
## Collections
|
283
283
|
|
284
284
|
# Supports --auto-correct
|
285
|
-
Layout/
|
285
|
+
Layout/ArrayAlignment:
|
286
286
|
Description: Align the elements of an array literal if they span more than one line.
|
287
287
|
Enabled: true
|
288
288
|
|
@@ -323,7 +323,7 @@ Layout/MultilineMethodCallIndentation:
|
|
323
323
|
## Strings
|
324
324
|
|
325
325
|
# Supports --auto-correct
|
326
|
-
Lint/
|
326
|
+
Lint/RedundantStringCoercion:
|
327
327
|
Description: Checks for Object#to_s usage in string interpolation.
|
328
328
|
Enabled: true
|
329
329
|
|
data/config/other-excludes.yml
CHANGED
data/config/other-lint.yml
CHANGED
data/config/other-style.yml
CHANGED
@@ -11,13 +11,13 @@ Style/Alias:
|
|
11
11
|
Description: 'Use alias_method instead of alias.'
|
12
12
|
Enabled: false
|
13
13
|
|
14
|
-
Layout/
|
14
|
+
Layout/HashAlignment:
|
15
15
|
Description: >-
|
16
16
|
Align the elements of a hash literal if they span more than
|
17
17
|
one line.
|
18
18
|
Enabled: false
|
19
19
|
|
20
|
-
Layout/
|
20
|
+
Layout/ParameterAlignment:
|
21
21
|
Description: >-
|
22
22
|
Align the parameters of a method call if they span more
|
23
23
|
than one line.
|
@@ -58,10 +58,6 @@ Style/BlockDelimiters:
|
|
58
58
|
Prefer {...} over do...end for single-line blocks.
|
59
59
|
Enabled: false
|
60
60
|
|
61
|
-
Style/BracesAroundHashParameters:
|
62
|
-
Description: 'Enforce braces style inside hash parameters.'
|
63
|
-
Enabled: true
|
64
|
-
|
65
61
|
Style/CaseEquality:
|
66
62
|
Description: 'Avoid explicit use of the case equality operator(===).'
|
67
63
|
Enabled: false
|
@@ -168,13 +164,13 @@ Style/IfWithSemicolon:
|
|
168
164
|
Description: 'Never use if x; .... Use the ternary operator instead.'
|
169
165
|
Enabled: false
|
170
166
|
|
171
|
-
Layout/
|
167
|
+
Layout/FirstArrayElementIndentation:
|
172
168
|
Description: >-
|
173
169
|
Checks the indentation of the first element in an array
|
174
170
|
literal.
|
175
171
|
Enabled: false
|
176
172
|
|
177
|
-
Layout/
|
173
|
+
Layout/FirstHashElementIndentation:
|
178
174
|
Description: 'Checks the indentation of the first key in a hash literal.'
|
179
175
|
Enabled: false
|
180
176
|
|
@@ -2,8 +2,15 @@
|
|
2
2
|
|
3
3
|
# By default Rails is switched off so this can be used by non-Rails apps,
|
4
4
|
# this can be enabled in a local .rubocop.yml file
|
5
|
+
|
6
|
+
require: rubocop-rails
|
7
|
+
|
8
|
+
AllCops:
|
9
|
+
Exclude:
|
10
|
+
- 'db/schema.rb'
|
11
|
+
|
5
12
|
Rails:
|
6
|
-
Enabled:
|
13
|
+
Enabled: true
|
7
14
|
|
8
15
|
Rails/ActionFilter:
|
9
16
|
Description: 'Enforces consistent use of action filter methods.'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-govuk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Government Digital Service
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '13.0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '13.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rubocop
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 0.80.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 0.80.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rubocop-rails
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -76,13 +76,13 @@ files:
|
|
76
76
|
- CHANGELOG.md
|
77
77
|
- LICENSE.md
|
78
78
|
- README.md
|
79
|
-
- config/
|
79
|
+
- config/default.yml
|
80
80
|
- config/gds-ruby-styleguide.yml
|
81
81
|
- config/other-excludes.yml
|
82
82
|
- config/other-lint.yml
|
83
83
|
- config/other-metrics.yml
|
84
|
-
- config/other-rails.yml
|
85
84
|
- config/other-style.yml
|
85
|
+
- config/rails.yml
|
86
86
|
homepage: https://github.com/alphagov/rubocop-govuk
|
87
87
|
licenses:
|
88
88
|
- MIT
|