rubocop-govuk 3.7.0 → 3.8.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: 9460cb1bd124d0db3bad61e69a4fca8fea76d1b58197766820aca957f4241854
4
- data.tar.gz: 13319b8ceece3b49c2c4363f23c418cebd5f87db081fe1eecb63afb777c88194
3
+ metadata.gz: ab10ddfc89214d7fae46f59e6c4b562938daa350796eb48e2f78ab56fcd7df7c
4
+ data.tar.gz: 574eef536a366973c7c7f8fd36d3a824ad034056957730247345899323a21f21
5
5
  SHA512:
6
- metadata.gz: 981c47d318c535003c5e3b5206ca85ead3fda8895c770d4957cc4ee19f698d4bd04ad3483c17d064b079b87e9276c188ce06f478413dc2ed11ee8b2ec2b61c7c
7
- data.tar.gz: 127e187db28bad0c6803c1fb8e8208277d55617698aef72befcddb4285449a62a65ee91836808b252f2a75c78fb40699d7b66ab0d4804cb523306d281866838a
6
+ metadata.gz: f11edcb99e6acaf178b3daaacedccd66764e8b660a824e12016057b5877cbd11249e41e08a7697ee5610fc8fb09a8ffe3834d748d6930bf4472294aa9633ff5c
7
+ data.tar.gz: 12cf45d1bb91ad44bf5cdc42e7a8d223a062e8ecf2156273d0c6bf298ff741747d146af837882dbf9700f321fb82a8b3b603d6fa1a39378ca5018230177a70e0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ # 3.8.0
2
+
3
+ * Enable check for flip-flops (#55)
4
+ * Enable Layout/FirstArrayElementIndentation (#56)
5
+ * Enable Layout/FirstHashElementIndentation (#56)
6
+ * Enable Naming/AsciiIdentifiers (#58)
7
+ * Enable Naming/FileName (#58)
8
+ * Enable Rails/ActionFilter (#59)
9
+ * Enable Rails/ScopeArgs (#59)
10
+
1
11
  # 3.7.0
2
12
 
3
13
  * Turn a load of Cops back on (#52)
data/config/default.yml CHANGED
@@ -22,7 +22,6 @@ AllCops:
22
22
  inherit_from:
23
23
  - bundler.yml
24
24
  - layout.yml
25
- - lint.yml
26
25
  - metrics.yml
27
26
  - naming.yml
28
27
  - style.yml
data/config/layout.yml CHANGED
@@ -15,8 +15,17 @@ Layout/LineLength:
15
15
  Description: Limit lines to 80 characters.
16
16
  Enabled: false
17
17
 
18
- # TODO: unclear why this is here!
19
- # https://github.com/alphagov/govuk-lint/commit/5e42ec5690e3d4cc8fff44d0b0268c8e581c423a
18
+ # We have two styles of method call in our apps:
19
+ #
20
+ # SomeClass.first_method_call_on_same_line
21
+ # .other_method_call
22
+ #
23
+ # a_particularly_long_first_method_call
24
+ # .subsequent_method_call
25
+ #
26
+ # Any setting of this Cop would cause odd alignment
27
+ # for one of these styles. Since there isn't a Cop to
28
+ # set a preferred style, we should disable this one.
20
29
  Layout/MultilineMethodCallIndentation:
21
30
  Enabled: false
22
31
 
@@ -28,24 +37,38 @@ Layout/AccessModifierIndentation:
28
37
  Enabled: true
29
38
  EnforcedStyle: outdent
30
39
 
31
- # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
32
- # TODO: unclear why this is here! Suggest enabling this with
33
- # "EnforcedStyle: consistent".
40
+ # Our predominant style of writing multiline arrays is:
41
+ #
42
+ # my_array = [
43
+ # element_1,
44
+ # element_2,
45
+ # ]
46
+ #
47
+ # even_in_a_method_call([
48
+ # element_1,
49
+ # element_2,
50
+ # ])
34
51
  Layout/FirstArrayElementIndentation:
35
- Description: >-
36
- Checks the indentation of the first element in an array
37
- literal.
38
- Enabled: false
52
+ EnforcedStyle: consistent
39
53
 
40
- # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
41
- # TODO: unclear why this is here! Suggest enabling this with
42
- # "EnforcedStyle: consistent".
54
+ # Our predominant style of writing multiline hashes is:
55
+ #
56
+ # my_hash = {
57
+ # key_1: value_1,
58
+ # key_2: value_2,
59
+ # }
60
+ #
61
+ # even_in_a_method_call({
62
+ # key_1: value_1,
63
+ # key_2: value_2,
64
+ # })
43
65
  Layout/FirstHashElementIndentation:
44
- Description: 'Checks the indentation of the first key in a hash literal.'
45
- Enabled: false
66
+ EnforcedStyle: consistent
46
67
 
68
+ # Our predominant style of writing multiline operations is
69
+ # to indent the subsequent lines. This helps to prevent
70
+ # misreading the next line as a new/separate statement.
71
+ #
47
72
  # Introduced in: 9b2a744ab119d7797aaf423abcec914360f4208e
48
- # "More lenient on multi-line operations"
49
- # TODO: unclear why this is here!
50
73
  Layout/MultilineOperationIndentation:
51
74
  EnforcedStyle: indented
data/config/metrics.yml CHANGED
@@ -46,7 +46,9 @@ Metrics/PerceivedComplexity:
46
46
  Enabled: false
47
47
 
48
48
  # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
49
- # TODO: unclear why this is here!
49
+ #
50
+ # We should avoid cops that are based on heuristics, since
51
+ # it's not clear what action to take to fix an issue.
50
52
  Metrics/BlockNesting:
51
53
  Description: 'Avoid excessive block nesting'
52
54
  Enabled: false
data/config/naming.yml CHANGED
@@ -1,21 +1,16 @@
1
+ # Conflicts with the original GDS styleguide
2
+ #
3
+ # While this may conflict with the original GDS styleguide, there
4
+ # are times where we wish to call a method that "sets" something.
5
+ #
6
+ # def set_political_and_government(edition)
7
+ #
8
+ # The original styleguide only accounts for a specific kind of "set"
9
+ # operation, where the argument is the value being assigned.
10
+ #
1
11
  # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
2
- # TODO: conflicts with the original GDS styleguide
3
- # "Avoid get/set method names"
4
12
  # https://github.com/alphagov/styleguides/blob/6395a10d41c3938f4c147cda443fd83f854c3e7a/ruby.md#naming
5
13
  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
14
  Enabled: false
20
15
 
21
16
  # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
data/config/rails.yml CHANGED
@@ -13,12 +13,6 @@ AllCops:
13
13
  Rails:
14
14
  Enabled: true
15
15
 
16
- # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
17
- # TODO: unclear why this is here!
18
- Rails/ActionFilter:
19
- Description: 'Enforces consistent use of action filter methods.'
20
- Enabled: false
21
-
22
16
  # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
23
17
  # TODO: unclear why this is here!
24
18
  Rails/HasAndBelongsToMany:
@@ -31,12 +25,6 @@ Rails/Output:
31
25
  Description: 'Checks for calls to puts, print, etc.'
32
26
  Enabled: false
33
27
 
34
- # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
35
- # TODO: unclear why this is here!
36
- Rails/ScopeArgs:
37
- Description: 'Checks the arguments of ActiveRecord scopes.'
38
- Enabled: false
39
-
40
28
  # Introduced in: 91d7bf4895db12727582ad7bf47bdcb20ab178f7
41
29
  # TODO: unclear (in any real detail) why this is here!
42
30
  Rails/SkipsModelValidations:
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: 3.7.0
4
+ version: 3.8.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: 2020-04-29 00:00:00.000000000 Z
11
+ date: 2020-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -93,7 +93,6 @@ files:
93
93
  - config/bundler.yml
94
94
  - config/default.yml
95
95
  - config/layout.yml
96
- - config/lint.yml
97
96
  - config/metrics.yml
98
97
  - config/naming.yml
99
98
  - config/rails.yml
@@ -118,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
117
  - !ruby/object:Gem::Version
119
118
  version: '0'
120
119
  requirements: []
121
- rubygems_version: 3.1.2
120
+ rubygems_version: 3.1.3
122
121
  signing_key:
123
122
  specification_version: 4
124
123
  summary: RuboCop GOV.UK
data/config/lint.yml DELETED
@@ -1,5 +0,0 @@
1
- # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
2
- # TODO: unclear why this is here!
3
- Lint/FlipFlop:
4
- Description: 'Checks for flip flops'
5
- Enabled: false