rubocop-govuk 3.3.0 → 3.6.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 +22 -0
- data/README.md +7 -3
- data/config/bundler.yml +12 -0
- data/config/default.yml +11 -6
- data/config/layout.yml +111 -0
- data/config/lint.yml +5 -0
- data/config/metrics.yml +79 -0
- data/config/naming.yml +25 -0
- data/config/rails.yml +16 -0
- data/config/rake.yml +1 -0
- data/config/style.yml +466 -0
- metadata +26 -10
- data/config/gds-ruby-styleguide.yml +0 -337
- data/config/other-excludes.yml +0 -16
- data/config/other-lint.yml +0 -129
- data/config/other-metrics.yml +0 -11
- data/config/other-style.yml +0 -391
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7ae8ec9e6faad9588c63a5f5ba23d6f81e6a902e6f9051b5619f78cc346f9e8
|
4
|
+
data.tar.gz: 3c0d65c5e8b25e0a6067ef266451080f777930a53b9f69f2085a44b400ae4665
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e20bb705063e2982eeab5943ec63597fe2093f87ca287238bcd1f1b7891e27dd26b025a95addc87a688655d5d745f916ba98e3c162affa2937af0da4beb3e30
|
7
|
+
data.tar.gz: ec7b6f473f7dc57946f4cf3d50a952beabfc74a910ad9000f2c52724d9e0f3cce90344607577c2abb098d5c3f638921d17c68fd8714f8a108770a8c63ec715b6
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,25 @@
|
|
1
|
+
# 3.6.0
|
2
|
+
|
3
|
+
* Remove config that matches RuboCop defaults (#47)
|
4
|
+
* Reorganise all the Cops (#44)
|
5
|
+
|
6
|
+
# 3.5.0
|
7
|
+
|
8
|
+
* Disable pending cops by default (#37)
|
9
|
+
|
10
|
+
# 3.4.0
|
11
|
+
|
12
|
+
* Add rubocop-rake cops (#32)
|
13
|
+
* Revert #27 (hash transform cops) (#31)
|
14
|
+
|
15
|
+
# 3.3.2
|
16
|
+
|
17
|
+
* Exclude /tmp directory (#29)
|
18
|
+
|
19
|
+
# 3.3.1
|
20
|
+
|
21
|
+
* Exclude two unsafe style cops (#27)
|
22
|
+
|
1
23
|
# 3.3.0
|
2
24
|
|
3
25
|
* Exclude Rails migrations from linting checks (#25)
|
data/README.md
CHANGED
@@ -16,7 +16,7 @@ Inherit rules from the gem by adding the following to your project's RuboCop con
|
|
16
16
|
```yaml
|
17
17
|
# .rubocop.yml
|
18
18
|
inherit_gem:
|
19
|
-
rubocop-govuk:
|
19
|
+
rubocop-govuk:
|
20
20
|
- config/default.yml
|
21
21
|
```
|
22
22
|
|
@@ -25,14 +25,18 @@ or if you also need Rails specific rules:
|
|
25
25
|
```yaml
|
26
26
|
# .rubocop.yml
|
27
27
|
inherit_gem:
|
28
|
-
rubocop-govuk:
|
28
|
+
rubocop-govuk:
|
29
29
|
- config/default.yml
|
30
30
|
- config/rails.yml
|
31
|
+
|
32
|
+
inherit_mode:
|
33
|
+
merge:
|
34
|
+
- Exclude
|
31
35
|
```
|
32
36
|
|
33
37
|
## Usage
|
34
38
|
|
35
|
-
Run RuboCop:
|
39
|
+
Run RuboCop:
|
36
40
|
|
37
41
|
```sh
|
38
42
|
bundle exec rubocop
|
data/config/bundler.yml
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# Introduced in: 278fc6e903834acfb37565795a196b85282560b0
|
2
|
+
# "A common pattern in our Gemfiles is to declare a gem
|
3
|
+
# differently if we're in a dev mode or not. For example
|
4
|
+
#
|
5
|
+
# if ENV['API_DEV']
|
6
|
+
# gem 'gds-api-adapters', path: '../gds-api-adapters'
|
7
|
+
# else
|
8
|
+
# gem 'gds-api-adapters', "~> 50.8.0"
|
9
|
+
# end"
|
10
|
+
# TODO: see if we can remove this (no longer valid??)
|
11
|
+
Bundler/DuplicatedGem:
|
12
|
+
Enabled: false
|
data/config/default.yml
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
AllCops:
|
2
|
+
NewCops: disable
|
2
3
|
Exclude:
|
3
4
|
- 'bin/**'
|
4
5
|
- 'config.ru'
|
5
|
-
- 'tmp
|
6
|
+
- 'tmp/**/*'
|
7
|
+
- 'db/schema.rb'
|
8
|
+
- 'db/migrate/201*'
|
6
9
|
|
7
10
|
DisplayCopNames:
|
8
11
|
Description: 'Display cop names in offense messages'
|
@@ -17,8 +20,10 @@ AllCops:
|
|
17
20
|
Enabled: true
|
18
21
|
|
19
22
|
inherit_from:
|
20
|
-
-
|
21
|
-
-
|
22
|
-
-
|
23
|
-
-
|
24
|
-
-
|
23
|
+
- bundler.yml
|
24
|
+
- layout.yml
|
25
|
+
- lint.yml
|
26
|
+
- metrics.yml
|
27
|
+
- naming.yml
|
28
|
+
- style.yml
|
29
|
+
- rake.yml
|
data/config/layout.yml
ADDED
@@ -0,0 +1,111 @@
|
|
1
|
+
# TODO: unclear why this is here!
|
2
|
+
# https://github.com/alphagov/govuk-lint/pull/38
|
3
|
+
Layout/ClosingParenthesisIndentation:
|
4
|
+
Description: 'Checks the indentation of hanging closing parentheses.'
|
5
|
+
Enabled: false
|
6
|
+
|
7
|
+
# Part of the orignal GDS styleguide
|
8
|
+
# "Use empty lines between defs and to break up a method into logical paragraphs."
|
9
|
+
# https://github.com/alphagov/styleguides/blob/6395a10d41c3938f4c147cda443fd83f854c3e7a/ruby.md#general
|
10
|
+
Layout/EmptyLineBetweenDefs:
|
11
|
+
Description: Use empty lines between defs.
|
12
|
+
Enabled: true
|
13
|
+
AllowAdjacentOneLineDefs: false
|
14
|
+
|
15
|
+
# https://github.com/alphagov/govuk-lint/pull/7
|
16
|
+
# "There are occasions where following this rule forces you to make the
|
17
|
+
# code less readable. This is particularly the case for tests where method
|
18
|
+
# names form the test descriptions. Keeping test descriptions under a
|
19
|
+
# certain length can force them to become cryptic."
|
20
|
+
Layout/LineLength:
|
21
|
+
Description: Limit lines to 80 characters.
|
22
|
+
Enabled: false
|
23
|
+
|
24
|
+
# TODO: unclear why this is here!
|
25
|
+
# https://github.com/alphagov/govuk-lint/commit/5e42ec5690e3d4cc8fff44d0b0268c8e581c423a
|
26
|
+
Layout/MultilineMethodCallIndentation:
|
27
|
+
Enabled: false
|
28
|
+
|
29
|
+
# Part of the orignal GDS styleguide
|
30
|
+
# "Outdent private etc"
|
31
|
+
# https://github.com/alphagov/styleguides/blob/6395a10d41c3938f4c147cda443fd83f854c3e7a/ruby.md#classes
|
32
|
+
Layout/AccessModifierIndentation:
|
33
|
+
Description: Check indentation of private/protected visibility modifiers.
|
34
|
+
Enabled: true
|
35
|
+
EnforcedStyle: outdent
|
36
|
+
|
37
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
38
|
+
# TODO: unclear why this is here!
|
39
|
+
Layout/HashAlignment:
|
40
|
+
Description: >-
|
41
|
+
Align the elements of a hash literal if they span more than
|
42
|
+
one line.
|
43
|
+
Enabled: false
|
44
|
+
|
45
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
46
|
+
# TODO: unclear why this is here!
|
47
|
+
Layout/ParameterAlignment:
|
48
|
+
Description: >-
|
49
|
+
Align the parameters of a method call if they span more
|
50
|
+
than one line.
|
51
|
+
Enabled: false
|
52
|
+
|
53
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
54
|
+
# TODO: unclear why this is here!
|
55
|
+
Layout/CommentIndentation:
|
56
|
+
Description: 'Indentation of comments.'
|
57
|
+
Enabled: false
|
58
|
+
|
59
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
60
|
+
# TODO: unclear why this is here!
|
61
|
+
Layout/DotPosition:
|
62
|
+
Description: 'Checks the position of the dot in multi-line method calls.'
|
63
|
+
Enabled: false
|
64
|
+
|
65
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
66
|
+
# TODO: unclear why this is here! Suggest enabling this with
|
67
|
+
# "EnforcedStyle: consistent".
|
68
|
+
Layout/FirstArrayElementIndentation:
|
69
|
+
Description: >-
|
70
|
+
Checks the indentation of the first element in an array
|
71
|
+
literal.
|
72
|
+
Enabled: false
|
73
|
+
|
74
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
75
|
+
# TODO: unclear why this is here! Suggest enabling this with
|
76
|
+
# "EnforcedStyle: consistent".
|
77
|
+
Layout/FirstHashElementIndentation:
|
78
|
+
Description: 'Checks the indentation of the first key in a hash literal.'
|
79
|
+
Enabled: false
|
80
|
+
|
81
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
82
|
+
# TODO: unclear why this is here!
|
83
|
+
Layout/LeadingCommentSpace:
|
84
|
+
Description: 'Comments should start with a space.'
|
85
|
+
Enabled: false
|
86
|
+
|
87
|
+
# Introduced in: 9b2a744ab119d7797aaf423abcec914360f4208e
|
88
|
+
# "More lenient on multi-line operations"
|
89
|
+
# TODO: unclear why this is here!
|
90
|
+
Layout/MultilineOperationIndentation:
|
91
|
+
EnforcedStyle: indented
|
92
|
+
|
93
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
94
|
+
# TODO: unclear why this is here!
|
95
|
+
Layout/SpaceAroundKeyword:
|
96
|
+
Description: 'Use spaces after if/elsif/unless/while/until/case/when.'
|
97
|
+
Enabled: false
|
98
|
+
|
99
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
100
|
+
# TODO: unclear why this is here!
|
101
|
+
Layout/SpaceAfterNot:
|
102
|
+
Description: Tracks redundant space after the ! operator.
|
103
|
+
Enabled: false
|
104
|
+
|
105
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
106
|
+
# TODO: unclear why this is here!
|
107
|
+
Layout/SpaceBeforeComment:
|
108
|
+
Description: >-
|
109
|
+
Checks for missing space between code and a comment on the
|
110
|
+
same line.
|
111
|
+
Enabled: false
|
data/config/lint.yml
ADDED
data/config/metrics.yml
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
# Introduced in: 195e1d6934e610efed35151cfe90b01b805d7581
|
2
|
+
# Introduced in: b7a98b43a4b0644b8d4ac40aa3ddaf35f06fa58f
|
3
|
+
# "Many test frameworks use blocks for the entire test
|
4
|
+
# case in a file as well as for individual tests within the file.
|
5
|
+
# It's not unusual for a test case to be several lines
|
6
|
+
# longer than the upper limit of the BlockLength cop,
|
7
|
+
# and there's very little we can do to avoid that so
|
8
|
+
# there's no point running this cop on our tests."
|
9
|
+
Metrics/BlockLength:
|
10
|
+
Enabled: true
|
11
|
+
Exclude:
|
12
|
+
- test/**/*
|
13
|
+
- "**/spec/**/*"
|
14
|
+
ExcludedMethods: ["namespace"]
|
15
|
+
|
16
|
+
# Introduced in: 736b3d295f88b9ba6676fc168b823535582388c2
|
17
|
+
# "Disable opinionated cops"
|
18
|
+
#
|
19
|
+
# We should avoid cops that are based on heuristics, since
|
20
|
+
# it's not clear what action to take to fix an issue.
|
21
|
+
Metrics/AbcSize:
|
22
|
+
Enabled: false
|
23
|
+
|
24
|
+
# Introduced in: 736b3d295f88b9ba6676fc168b823535582388c2
|
25
|
+
# "Disable opinionated cops"
|
26
|
+
#
|
27
|
+
# We should avoid cops that are based on heuristics, since
|
28
|
+
# it's not clear what action to take to fix an issue.
|
29
|
+
Metrics/ClassLength:
|
30
|
+
Enabled: false
|
31
|
+
|
32
|
+
# Introduced in: 736b3d295f88b9ba6676fc168b823535582388c2
|
33
|
+
# "Disable opinionated cops"
|
34
|
+
#
|
35
|
+
# We should avoid cops that are based on heuristics, since
|
36
|
+
# it's not clear what action to take to fix an issue.
|
37
|
+
Metrics/ModuleLength:
|
38
|
+
Enabled: false
|
39
|
+
|
40
|
+
# Introduced in: 736b3d295f88b9ba6676fc168b823535582388c2
|
41
|
+
# "Disable opinionated cops"
|
42
|
+
#
|
43
|
+
# We should avoid cops that are based on heuristics, since
|
44
|
+
# it's not clear what action to take to fix an issue.
|
45
|
+
Metrics/PerceivedComplexity:
|
46
|
+
Enabled: false
|
47
|
+
|
48
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
49
|
+
# TODO: unclear why this is here!
|
50
|
+
Metrics/BlockNesting:
|
51
|
+
Description: 'Avoid excessive block nesting'
|
52
|
+
Enabled: false
|
53
|
+
|
54
|
+
# Analog of: 736b3d295f88b9ba6676fc168b823535582388c2
|
55
|
+
# "Disable opinionated cops"
|
56
|
+
#
|
57
|
+
# We should avoid cops that are based on heuristics, since
|
58
|
+
# it's not clear what action to take to fix an issue.
|
59
|
+
Metrics/CyclomaticComplexity:
|
60
|
+
Description: 'Avoid complex methods.'
|
61
|
+
Enabled: false
|
62
|
+
|
63
|
+
# Analog of: 736b3d295f88b9ba6676fc168b823535582388c2
|
64
|
+
# "Disable opinionated cops"
|
65
|
+
#
|
66
|
+
# We should avoid cops that are based on heuristics, since
|
67
|
+
# it's not clear what action to take to fix an issue.
|
68
|
+
Metrics/MethodLength:
|
69
|
+
Description: 'Avoid methods longer than 10 lines of code.'
|
70
|
+
Enabled: false
|
71
|
+
|
72
|
+
# Analog of: 736b3d295f88b9ba6676fc168b823535582388c2
|
73
|
+
# "Disable opinionated cops"
|
74
|
+
#
|
75
|
+
# We should avoid cops that are based on heuristics, since
|
76
|
+
# it's not clear what action to take to fix an issue.
|
77
|
+
Metrics/ParameterLists:
|
78
|
+
Description: 'Avoid parameter lists longer than three or four parameters.'
|
79
|
+
Enabled: false
|
data/config/naming.yml
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
2
|
+
# TODO: conflicts with the original GDS styleguide
|
3
|
+
# "Avoid get/set method names"
|
4
|
+
# https://github.com/alphagov/styleguides/blob/6395a10d41c3938f4c147cda443fd83f854c3e7a/ruby.md#naming
|
5
|
+
Naming/AccessorMethodName:
|
6
|
+
Description: Check the naming of accessor methods for get_/set_.
|
7
|
+
Enabled: false
|
8
|
+
|
9
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
10
|
+
# TODO: unclear why this is here!
|
11
|
+
Naming/AsciiIdentifiers:
|
12
|
+
Description: 'Use only ascii symbols in identifiers.'
|
13
|
+
Enabled: false
|
14
|
+
|
15
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
16
|
+
# TODO: unclear why this is here!
|
17
|
+
Naming/FileName:
|
18
|
+
Description: 'Use snake_case for source file names.'
|
19
|
+
Enabled: false
|
20
|
+
|
21
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
22
|
+
# TODO: unclear why this is here!
|
23
|
+
Naming/PredicateName:
|
24
|
+
Description: 'Check the names of predicate methods.'
|
25
|
+
Enabled: false
|
data/config/rails.yml
CHANGED
@@ -13,34 +13,50 @@ AllCops:
|
|
13
13
|
Rails:
|
14
14
|
Enabled: true
|
15
15
|
|
16
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
17
|
+
# TODO: unclear why this is here!
|
16
18
|
Rails/ActionFilter:
|
17
19
|
Description: 'Enforces consistent use of action filter methods.'
|
18
20
|
Enabled: false
|
19
21
|
|
22
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
23
|
+
# TODO: unclear why this is here!
|
20
24
|
Rails/Delegate:
|
21
25
|
Description: 'Prefer delegate method for delegations.'
|
22
26
|
Enabled: false
|
23
27
|
|
28
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
29
|
+
# TODO: unclear why this is here!
|
24
30
|
Rails/HasAndBelongsToMany:
|
25
31
|
Description: 'Prefer has_many :through to has_and_belongs_to_many.'
|
26
32
|
Enabled: false
|
27
33
|
|
34
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
35
|
+
# TODO: unclear why this is here!
|
28
36
|
Rails/Output:
|
29
37
|
Description: 'Checks for calls to puts, print, etc.'
|
30
38
|
Enabled: false
|
31
39
|
|
40
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
41
|
+
# TODO: unclear why this is here!
|
32
42
|
Rails/ReadWriteAttribute:
|
33
43
|
Description: 'Checks for read_attribute(:attr) and write_attribute(:attr, val).'
|
34
44
|
Enabled: false
|
35
45
|
|
46
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
47
|
+
# TODO: unclear why this is here!
|
36
48
|
Rails/ScopeArgs:
|
37
49
|
Description: 'Checks the arguments of ActiveRecord scopes.'
|
38
50
|
Enabled: false
|
39
51
|
|
52
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
53
|
+
# TODO: unclear why this is here!
|
40
54
|
Rails/Validation:
|
41
55
|
Description: 'Use sexy validations.'
|
42
56
|
Enabled: false
|
43
57
|
|
58
|
+
# Introduced in: 91d7bf4895db12727582ad7bf47bdcb20ab178f7
|
59
|
+
# TODO: unclear (in any real detail) why this is here!
|
44
60
|
Rails/SkipsModelValidations:
|
45
61
|
Description: 'Avoid methods that skip model validations.'
|
46
62
|
Enabled: false
|
data/config/rake.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require: rubocop-rake
|
data/config/style.yml
ADDED
@@ -0,0 +1,466 @@
|
|
1
|
+
# https://github.com/alphagov/govuk-lint/pull/36
|
2
|
+
# "When we have sequence of if/unless statements,
|
3
|
+
# some with multiple lines within the if statement
|
4
|
+
# block and some with a single line, forcing the single
|
5
|
+
# line statements to re-written makes it a harder
|
6
|
+
# to follow the branching logic."
|
7
|
+
Style/IfUnlessModifier:
|
8
|
+
Description: Favor modifier if/unless usage when you have a single-line body.
|
9
|
+
Enabled: false
|
10
|
+
|
11
|
+
# Part of the orignal GDS styleguide
|
12
|
+
# "Never chain do...end"
|
13
|
+
# https://github.com/alphagov/styleguides/blob/6395a10d41c3938f4c147cda443fd83f854c3e7a/ruby.md#syntax
|
14
|
+
Style/MethodCalledOnDoEndBlock:
|
15
|
+
Description: Avoid chaining a method call on a do...end block.
|
16
|
+
Enabled: true
|
17
|
+
|
18
|
+
# Part of the orignal GDS styleguide
|
19
|
+
# "Omit the parentheses when the method doesn’t accept any arguments"
|
20
|
+
# https://github.com/alphagov/styleguides/blob/6395a10d41c3938f4c147cda443fd83f854c3e7a/ruby.md#syntax
|
21
|
+
Style/MethodCallWithoutArgsParentheses:
|
22
|
+
Description: 'Do not use parentheses for method calls with no arguments.'
|
23
|
+
Enabled: true
|
24
|
+
|
25
|
+
# Part of the orignal GDS styleguide
|
26
|
+
# "Use Ruby 1.9 syntax for symbolic hash keys.
|
27
|
+
# This includes method calls."
|
28
|
+
# https://github.com/alphagov/styleguides/blob/6395a10d41c3938f4c147cda443fd83f854c3e7a/ruby.md#collections
|
29
|
+
Style/HashSyntax:
|
30
|
+
Exclude:
|
31
|
+
- 'db/schema.rb'
|
32
|
+
|
33
|
+
# Part of the orignal GDS styleguide
|
34
|
+
# "Add a trailing comma to multi-line array [...]
|
35
|
+
# for clearer diffs with less line noise."
|
36
|
+
# https://github.com/alphagov/styleguides/blob/6395a10d41c3938f4c147cda443fd83f854c3e7a/ruby.md#collections
|
37
|
+
Style/TrailingCommaInArrayLiteral:
|
38
|
+
EnforcedStyleForMultiline: comma
|
39
|
+
|
40
|
+
# Part of the orignal GDS styleguide
|
41
|
+
# "Add a trailing comma to multi-line hash definitions [...]
|
42
|
+
# for clearer diffs with less line noise."
|
43
|
+
# https://github.com/alphagov/styleguides/blob/6395a10d41c3938f4c147cda443fd83f854c3e7a/ruby.md#collections
|
44
|
+
Style/TrailingCommaInHashLiteral:
|
45
|
+
EnforcedStyleForMultiline: comma
|
46
|
+
|
47
|
+
# Part of the orignal GDS styleguide
|
48
|
+
# "When long lists of method arguments require
|
49
|
+
# breaking over multiple lines, break each successive
|
50
|
+
# argument on a new line, including the first argument
|
51
|
+
# and closing paren. The final argument should include
|
52
|
+
# a trailing comma."
|
53
|
+
# https://github.com/alphagov/styleguides/blob/6395a10d41c3938f4c147cda443fd83f854c3e7a/ruby.md#general
|
54
|
+
Style/TrailingCommaInArguments:
|
55
|
+
EnforcedStyleForMultiline: comma
|
56
|
+
|
57
|
+
# Part of the orignal GDS styleguide
|
58
|
+
# "Prefer %w to the literal array syntax when you need
|
59
|
+
# an array of strings."
|
60
|
+
# https://github.com/alphagov/styleguides/blob/6395a10d41c3938f4c147cda443fd83f854c3e7a/ruby.md#collections
|
61
|
+
Style/WordArray:
|
62
|
+
MinSize: 0
|
63
|
+
|
64
|
+
# "Try not to mix up single-quoted and double-quoted
|
65
|
+
# strings within a file: it can make the code harder to read.
|
66
|
+
# Definitely don't mix up single-quoted and double-quoted
|
67
|
+
# strings within a method. If in doubt, use double-quoted strings,
|
68
|
+
# because you’ll probably need to use interpolation somewhere.
|
69
|
+
Style/StringLiterals:
|
70
|
+
EnforcedStyle: double_quotes
|
71
|
+
|
72
|
+
# Introduced in: 5ca6b7d20fd62a6ce890868abdeca12837e436d7
|
73
|
+
# "The wording of the description is hard to understand - it's not
|
74
|
+
# immediately obvious what you have to do, and doesn't really say why
|
75
|
+
# this is a good thing.
|
76
|
+
#
|
77
|
+
# It's not auto-fixable, which means it takes a lot of time to get the
|
78
|
+
# syntax right for every occurrence of `%.2f` for example (taken from
|
79
|
+
# `smart-answers`) for not very much benefit."
|
80
|
+
Style/FormatStringToken:
|
81
|
+
Enabled: false
|
82
|
+
|
83
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
84
|
+
# TODO: unclear why this is here!
|
85
|
+
Style/Alias:
|
86
|
+
Description: 'Use alias_method instead of alias.'
|
87
|
+
Enabled: false
|
88
|
+
|
89
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
90
|
+
# TODO: unclear why this is here!
|
91
|
+
Style/ArrayJoin:
|
92
|
+
Description: 'Use Array#join instead of Array#*.'
|
93
|
+
Enabled: false
|
94
|
+
|
95
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
96
|
+
# TODO: unclear why this is here!
|
97
|
+
Style/AsciiComments:
|
98
|
+
Description: 'Use only ascii symbols in comments.'
|
99
|
+
Enabled: false
|
100
|
+
|
101
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
102
|
+
# TODO: unclear why this is here!
|
103
|
+
Style/Attr:
|
104
|
+
Description: 'Checks for uses of Module#attr.'
|
105
|
+
Enabled: false
|
106
|
+
|
107
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
108
|
+
# TODO: unclear why this is here!
|
109
|
+
Style/BeginBlock:
|
110
|
+
Description: 'Avoid the use of BEGIN blocks.'
|
111
|
+
Enabled: false
|
112
|
+
|
113
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
114
|
+
# TODO: unclear why this is here!
|
115
|
+
Style/BlockComments:
|
116
|
+
Description: 'Do not use block comments.'
|
117
|
+
Enabled: false
|
118
|
+
|
119
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
120
|
+
# TODO: unclear why this is here!
|
121
|
+
Style/BlockDelimiters:
|
122
|
+
Description: >-
|
123
|
+
Avoid using {...} for multi-line blocks (multiline chaining is
|
124
|
+
always ugly).
|
125
|
+
Prefer {...} over do...end for single-line blocks.
|
126
|
+
Enabled: false
|
127
|
+
|
128
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
129
|
+
# TODO: unclear why this is here!
|
130
|
+
Style/CaseEquality:
|
131
|
+
Description: 'Avoid explicit use of the case equality operator(===).'
|
132
|
+
Enabled: false
|
133
|
+
|
134
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
135
|
+
# TODO: unclear why this is here!
|
136
|
+
Style/CharacterLiteral:
|
137
|
+
Description: 'Checks for uses of character literals.'
|
138
|
+
Enabled: false
|
139
|
+
|
140
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
141
|
+
# TODO: unclear why this is here!
|
142
|
+
Style/ClassAndModuleChildren:
|
143
|
+
Description: 'Checks style of children classes and modules.'
|
144
|
+
Enabled: false
|
145
|
+
|
146
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
147
|
+
# TODO: unclear why this is here!
|
148
|
+
Style/ColonMethodCall:
|
149
|
+
Description: 'Do not use :: for method call.'
|
150
|
+
Enabled: false
|
151
|
+
|
152
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
153
|
+
# TODO: unclear why this is here!
|
154
|
+
Style/CommentAnnotation:
|
155
|
+
Description: >-
|
156
|
+
Checks formatting of special comments
|
157
|
+
(TODO, FIXME, OPTIMIZE, HACK, REVIEW).
|
158
|
+
Enabled: false
|
159
|
+
|
160
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
161
|
+
# TODO: unclear why this is here!
|
162
|
+
Style/PreferredHashMethods:
|
163
|
+
Description: 'Checks for use of deprecated Hash methods.'
|
164
|
+
Enabled: false
|
165
|
+
|
166
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
167
|
+
# Documenting every class is a lot of effort and we don't
|
168
|
+
# expect to get any value from this. Another risk of adding
|
169
|
+
# more documentation is the potential for confusion if that
|
170
|
+
# documentation gets out-of-sync with the class/module.
|
171
|
+
Style/Documentation:
|
172
|
+
Description: 'Document classes and non-namespace modules.'
|
173
|
+
Enabled: false
|
174
|
+
|
175
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
176
|
+
# TODO: unclear why this is here!
|
177
|
+
Style/DoubleNegation:
|
178
|
+
Description: 'Checks for uses of double negation (!!).'
|
179
|
+
Enabled: false
|
180
|
+
|
181
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
182
|
+
# TODO: unclear why this is here!
|
183
|
+
Style/EachWithObject:
|
184
|
+
Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
|
185
|
+
Enabled: false
|
186
|
+
|
187
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
188
|
+
# TODO: unclear why this is here!
|
189
|
+
Style/EmptyLiteral:
|
190
|
+
Description: 'Prefer literals to Array.new/Hash.new/String.new.'
|
191
|
+
Enabled: false
|
192
|
+
|
193
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
194
|
+
# TODO: unclear why this is here!
|
195
|
+
Style/Encoding:
|
196
|
+
Description: 'Use UTF-8 as the source file encoding.'
|
197
|
+
Enabled: false
|
198
|
+
|
199
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
200
|
+
# TODO: unclear why this is here!
|
201
|
+
Style/EndBlock:
|
202
|
+
Description: 'Avoid the use of END blocks.'
|
203
|
+
Enabled: false
|
204
|
+
|
205
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
206
|
+
# TODO: unclear why this is here!
|
207
|
+
Style/EvenOdd:
|
208
|
+
Description: 'Favor the use of Fixnum#even? && Fixnum#odd?'
|
209
|
+
Enabled: false
|
210
|
+
|
211
|
+
# TODO: duplicate (other-excludes.yml), remove
|
212
|
+
Style/FormatString:
|
213
|
+
Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
|
214
|
+
Enabled: false
|
215
|
+
|
216
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
217
|
+
# TODO: unclear why this is here!
|
218
|
+
Style/GlobalVars:
|
219
|
+
Description: 'Do not introduce global variables.'
|
220
|
+
Enabled: false
|
221
|
+
|
222
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
223
|
+
# This can lead to excessively long lines. Consistent with
|
224
|
+
# disabling "Layout/LineLength".
|
225
|
+
#
|
226
|
+
# "There are occasions where following this rule forces you to make the
|
227
|
+
# code less readable."
|
228
|
+
Style/GuardClause:
|
229
|
+
Description: 'Check for conditionals that can be replaced with guard clauses'
|
230
|
+
Enabled: false
|
231
|
+
|
232
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
233
|
+
# TODO: unclear why this is here!
|
234
|
+
Style/IfWithSemicolon:
|
235
|
+
Description: 'Never use if x; .... Use the ternary operator instead.'
|
236
|
+
Enabled: false
|
237
|
+
|
238
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
239
|
+
# TODO: unclear why this is here!
|
240
|
+
Style/Lambda:
|
241
|
+
Description: 'Use the new lambda literal syntax for single-line blocks.'
|
242
|
+
Enabled: false
|
243
|
+
|
244
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
245
|
+
# TODO: unclear why this is here!
|
246
|
+
Style/LambdaCall:
|
247
|
+
Description: 'Use lambda.call(...) instead of lambda.(...).'
|
248
|
+
Enabled: false
|
249
|
+
|
250
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
251
|
+
# TODO: unclear why this is here!
|
252
|
+
Style/LineEndConcatenation:
|
253
|
+
Description: >-
|
254
|
+
Use \ instead of + or << to concatenate two string literals at
|
255
|
+
line end.
|
256
|
+
Enabled: false
|
257
|
+
|
258
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
259
|
+
# TODO: unclear why this is here!
|
260
|
+
Style/MethodDefParentheses:
|
261
|
+
Description: >-
|
262
|
+
Checks if the method definitions have or don't have
|
263
|
+
parentheses.
|
264
|
+
Enabled: false
|
265
|
+
|
266
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
267
|
+
# TODO: unclear why this is here!
|
268
|
+
Style/ModuleFunction:
|
269
|
+
Description: 'Checks for usage of `extend self` in modules.'
|
270
|
+
Enabled: false
|
271
|
+
|
272
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
273
|
+
# TODO: unclear why this is here!
|
274
|
+
Style/NegatedIf:
|
275
|
+
Description: >-
|
276
|
+
Favor unless over if for negative conditions
|
277
|
+
(or control flow or).
|
278
|
+
Enabled: false
|
279
|
+
|
280
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
281
|
+
# TODO: unclear why this is here!
|
282
|
+
Style/NegatedWhile:
|
283
|
+
Description: 'Favor until over while for negative conditions.'
|
284
|
+
Enabled: false
|
285
|
+
|
286
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
287
|
+
# TODO: unclear why this is here!
|
288
|
+
Style/Next:
|
289
|
+
Description: 'Use `next` to skip iteration instead of a condition at the end.'
|
290
|
+
Enabled: false
|
291
|
+
|
292
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
293
|
+
# TODO: unclear why this is here!
|
294
|
+
Style/NilComparison:
|
295
|
+
Description: 'Prefer x.nil? to x == nil.'
|
296
|
+
Enabled: false
|
297
|
+
|
298
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
299
|
+
# TODO: unclear why this is here!
|
300
|
+
Style/NonNilCheck:
|
301
|
+
Description: 'Checks for redundant nil checks.'
|
302
|
+
Enabled: false
|
303
|
+
|
304
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
305
|
+
# TODO: unclear why this is here!
|
306
|
+
Style/Not:
|
307
|
+
Description: 'Use ! instead of not.'
|
308
|
+
Enabled: false
|
309
|
+
|
310
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
311
|
+
# TODO: unclear why this is here!
|
312
|
+
Style/NumericLiterals:
|
313
|
+
Description: >-
|
314
|
+
Add underscores to large numeric literals to improve their
|
315
|
+
readability.
|
316
|
+
Enabled: false
|
317
|
+
|
318
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
319
|
+
# TODO: unclear why this is here!
|
320
|
+
Style/PercentLiteralDelimiters:
|
321
|
+
Description: 'Use `%`-literal delimiters consistently'
|
322
|
+
Enabled: false
|
323
|
+
|
324
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
325
|
+
# TODO: unclear why this is here!
|
326
|
+
Style/PerlBackrefs:
|
327
|
+
Description: 'Avoid Perl-style regex back references.'
|
328
|
+
Enabled: false
|
329
|
+
|
330
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
331
|
+
# TODO: unclear why this is here!
|
332
|
+
Style/Proc:
|
333
|
+
Description: 'Use proc instead of Proc.new.'
|
334
|
+
Enabled: false
|
335
|
+
|
336
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
337
|
+
# TODO: unclear why this is here! Suggest enabling with
|
338
|
+
# "EnforcedStyle: compact"
|
339
|
+
Style/RaiseArgs:
|
340
|
+
Description: 'Checks the arguments passed to raise/fail.'
|
341
|
+
Enabled: false
|
342
|
+
|
343
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
344
|
+
# TODO: unclear why this is here!
|
345
|
+
Style/RedundantBegin:
|
346
|
+
Description: "Don't use begin blocks when they are not needed."
|
347
|
+
Enabled: false
|
348
|
+
|
349
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
350
|
+
# TODO: unclear why this is here!
|
351
|
+
Style/RedundantException:
|
352
|
+
Description: "Checks for an obsolete RuntimeException argument in raise/fail."
|
353
|
+
Enabled: false
|
354
|
+
|
355
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
356
|
+
# TODO: unclear why this is here!
|
357
|
+
Style/RedundantSelf:
|
358
|
+
Description: "Don't use self where it's not needed."
|
359
|
+
Enabled: false
|
360
|
+
|
361
|
+
# Analog of: 736b3d295f88b9ba6676fc168b823535582388c2
|
362
|
+
# "Disable opinionated cops"
|
363
|
+
#
|
364
|
+
# We should avoid cops that are based on heuristics, since
|
365
|
+
# it's not clear what action to take to fix an issue.
|
366
|
+
Style/RegexpLiteral:
|
367
|
+
Description: >-
|
368
|
+
Use %r for regular expressions matching more than
|
369
|
+
`MaxSlashes` '/' characters.
|
370
|
+
Use %r only for regular expressions matching more than
|
371
|
+
`MaxSlashes` '/' character.
|
372
|
+
Enabled: false
|
373
|
+
|
374
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
375
|
+
# TODO: unclear why this is here!
|
376
|
+
Style/RescueModifier:
|
377
|
+
Description: 'Avoid using rescue in its modifier form.'
|
378
|
+
Enabled: false
|
379
|
+
|
380
|
+
# Introduced in: 7aaebf4dbdf2a8d677b4000d3cd3512d4fb91e99
|
381
|
+
# "This is a relatively new Ruby feature and is not mentioned in the Style
|
382
|
+
# guide, so this commit disables it by default."
|
383
|
+
# TODO: unclear why this is here!
|
384
|
+
Style/SafeNavigation:
|
385
|
+
Description: >-
|
386
|
+
This cop transforms usages of a method call safeguarded by a check for the
|
387
|
+
existance of the object to safe navigation (`&.`).
|
388
|
+
Enabled: false
|
389
|
+
|
390
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
391
|
+
# TODO: unclear why this is here!
|
392
|
+
Style/SelfAssignment:
|
393
|
+
Description: 'Checks for places where self-assignment shorthand should have been used.'
|
394
|
+
Enabled: false
|
395
|
+
|
396
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
397
|
+
# TODO: unclear why this is here!
|
398
|
+
Style/Semicolon:
|
399
|
+
Description: "Don't use semicolons to terminate expressions."
|
400
|
+
Enabled: false
|
401
|
+
|
402
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
403
|
+
# TODO: unclear why this is here!
|
404
|
+
Style/SignalException:
|
405
|
+
Description: 'Checks for proper usage of fail and raise.'
|
406
|
+
Enabled: false
|
407
|
+
|
408
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
409
|
+
# TODO: unclear why this is here! Suggest enabling with
|
410
|
+
# "AllowIfMethodIsEmpty: true" to accommodate Rails actions.
|
411
|
+
Style/SingleLineMethods:
|
412
|
+
Description: 'Avoid single-line methods.'
|
413
|
+
Enabled: false
|
414
|
+
|
415
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
416
|
+
# TODO: unclear why this is here!
|
417
|
+
Style/SpecialGlobalVars:
|
418
|
+
Description: 'Avoid Perl-style global variables.'
|
419
|
+
Enabled: false
|
420
|
+
|
421
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
422
|
+
# TODO: unclear why this is here!
|
423
|
+
Style/RedundantCapitalW:
|
424
|
+
Description: 'Checks for %W when interpolation is not needed.'
|
425
|
+
Enabled: false
|
426
|
+
|
427
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
428
|
+
# TODO: unclear why this is here!
|
429
|
+
Style/CommandLiteral:
|
430
|
+
Description: 'Checks for %x when `` would do.'
|
431
|
+
Enabled: false
|
432
|
+
|
433
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
434
|
+
# TODO: unclear why this is here!
|
435
|
+
Style/VariableInterpolation:
|
436
|
+
Description: >-
|
437
|
+
Don't interpolate global, instance and class variables
|
438
|
+
directly in strings.
|
439
|
+
Enabled: false
|
440
|
+
|
441
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
442
|
+
# TODO: unclear why this is here!
|
443
|
+
Style/WhenThen:
|
444
|
+
Description: 'Use when x then ... for one-line cases.'
|
445
|
+
Enabled: false
|
446
|
+
|
447
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
448
|
+
# TODO: unclear why this is here!
|
449
|
+
Style/WhileUntilDo:
|
450
|
+
Description: 'Checks for redundant do after while or until.'
|
451
|
+
Enabled: false
|
452
|
+
|
453
|
+
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
454
|
+
# TODO: unclear why this is here!
|
455
|
+
Style/WhileUntilModifier:
|
456
|
+
Description: >-
|
457
|
+
Favor modifier while/until usage when you have a
|
458
|
+
single-line body.
|
459
|
+
Enabled: false
|
460
|
+
|
461
|
+
# Introduced in: b171d652d3e434b74ddc621df3b5be24c49bc7e8
|
462
|
+
# This cop was added in preperation for a Ruby feature
|
463
|
+
# that is no longer likely to become part of the language.
|
464
|
+
# https://github.com/rubocop-hq/rubocop/issues/7197
|
465
|
+
Style/FrozenStringLiteralComment:
|
466
|
+
Enabled: false
|