rubocop-govuk 3.9.0 → 3.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +13 -0
  3. data/config/layout.yml +28 -0
  4. data/config/style.yml +10 -37
  5. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f9c2665fb72c667c3f07e7b9c58773452d606d6ef538eb8a72ec737db214387c
4
- data.tar.gz: a651269b0301ba985c67ca643505becad473424dacb789cabfc0ecca51e756c9
3
+ metadata.gz: 9e5ccad5d8a29404c085805725894f1e34fcddd9a8081fb6d49dc46fcb83c442
4
+ data.tar.gz: bff295ee9cf144c60f5b2653f7c3744e886c34303032d443d735f022269cb94e
5
5
  SHA512:
6
- metadata.gz: 151c3d8ec8811c0f8921a4f3ce842527e0c9b677a425c17891da6e379c97b30b1f22fad6f18e4dfcfa4f65a492baea8b62060431830b057bfb83b575448318ae
7
- data.tar.gz: 7516c91b9bc30c5565fcff0000a456c48f8adecd3fcc74f4675bd0f6172798d5fa5d70402b7f92b502b45d0af196ca782a438ef71753e4cbd4907fe622a61d71
6
+ metadata.gz: 5dfb9ea5aca2f9158feb74e46141b32b0a48054ccfa90e82f5cf337a26bcd9ab12ffefc005f930828f0839afdee26fc9aaf22695421dfc6672678ec6e36ab440
7
+ data.tar.gz: 34c1d26adf2d8d9118ffccca9128ba3f402328d6378865d949c50707fcd38d2b58c7dbcd91de33d3ea9937d5b9570c8aee670bc73ed284f405b53d86470503b0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ # 3.10.0
2
+
3
+ * Enable Style/NegatedIf (#71)
4
+ * Enable Style/GlobalVars (#71)
5
+ * Enable Style/RaiseArgs (#71)
6
+ * Enable Style/MethodDefParentheses (#71)
7
+ * Enable Style/NumericLiterals (#71)
8
+ * Enable Layout/MultilineArrayLineBreaks (#63)
9
+ * Enable Layout/MultilineHashKeyLineBreaks (#63)
10
+ * Enable Layout/MultilineMethodArgumentLineBreaks (#63)
11
+ * Enable Layout/FirstMethodArgumentLineBreak (#63)
12
+ * Fix bug with Style/FormatString (#70)
13
+
1
14
  # 3.9.0
2
15
 
3
16
  * Enable Style/Alias (#60)
data/config/layout.yml CHANGED
@@ -72,3 +72,31 @@ Layout/FirstHashElementIndentation:
72
72
  # Introduced in: 9b2a744ab119d7797aaf423abcec914360f4208e
73
73
  Layout/MultilineOperationIndentation:
74
74
  EnforcedStyle: indented
75
+
76
+ # We should be consistent: if some items of an array are
77
+ # on multiple lines, then all items should be. This works
78
+ # better with the indentation Cops, produces clearer diffs,
79
+ # and avoids wasting time tweaking an arbitrary layout.
80
+ Layout/MultilineArrayLineBreaks:
81
+ Enabled: true
82
+
83
+ # We should be consistent: if some items of a hash are
84
+ # on multiple lines, then all items should be. This works
85
+ # better with the indentation Cops, produces clearer diffs,
86
+ # and avoids wasting time tweaking an arbitrary layout.
87
+ Layout/MultilineHashKeyLineBreaks:
88
+ Enabled: true
89
+
90
+ # We should be consistent: if some items of a method call are
91
+ # on multiple lines, then all items should be. This works
92
+ # better with the indentation Cops, produces clearer diffs,
93
+ # and avoids wasting time tweaking an arbitrary layout.
94
+ Layout/MultilineMethodArgumentLineBreaks:
95
+ Enabled: true
96
+
97
+ # We should put each argument of a method call on a new line,
98
+ # if any are on new lines. This prevents unnecessary decisions
99
+ # about which style to use; the multiline style also helps to
100
+ # avoid excessively long lines.
101
+ Layout/FirstMethodArgumentLineBreak:
102
+ Enabled: true
data/config/style.yml CHANGED
@@ -80,6 +80,16 @@ Style/StringLiterals:
80
80
  Style/FormatStringToken:
81
81
  Enabled: false
82
82
 
83
+ # Using the default style leads to buggy auto-correct in several
84
+ # repos that have their own 'format' method defined. While it's not
85
+ # ideal to override a standard/Kernel method, it's also not practical
86
+ # to change a term that's so deeply embedded within our domain.
87
+ #
88
+ # Related PR: https://github.com/alphagov/specialist-publisher/pull/1640
89
+ # Related PR: https://github.com/alphagov/publisher/pull/1268
90
+ Style/FormatString:
91
+ EnforcedStyle: sprintf
92
+
83
93
  # This is a contentious issue, since 'alias_method' works in
84
94
  # all circumstances, whereas 'alias' only works lexically. As
85
95
  # with single vs. double quotes, it seems pointless to expend
@@ -121,12 +131,6 @@ Style/Documentation:
121
131
  Description: 'Document classes and non-namespace modules.'
122
132
  Enabled: false
123
133
 
124
- # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
125
- # TODO: unclear why this is here!
126
- Style/GlobalVars:
127
- Description: 'Do not introduce global variables.'
128
- Enabled: false
129
-
130
134
  # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
131
135
  # This can lead to excessively long lines. Consistent with
132
136
  # disabling "Layout/LineLength".
@@ -137,43 +141,12 @@ Style/GuardClause:
137
141
  Description: 'Check for conditionals that can be replaced with guard clauses'
138
142
  Enabled: false
139
143
 
140
- # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
141
- # TODO: unclear why this is here!
142
- Style/MethodDefParentheses:
143
- Description: >-
144
- Checks if the method definitions have or don't have
145
- parentheses.
146
- Enabled: false
147
-
148
- # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
149
- # TODO: unclear why this is here!
150
- Style/NegatedIf:
151
- Description: >-
152
- Favor unless over if for negative conditions
153
- (or control flow or).
154
- Enabled: false
155
-
156
144
  # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
157
145
  # TODO: unclear why this is here!
158
146
  Style/Next:
159
147
  Description: 'Use `next` to skip iteration instead of a condition at the end.'
160
148
  Enabled: false
161
149
 
162
- # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
163
- # TODO: unclear why this is here!
164
- Style/NumericLiterals:
165
- Description: >-
166
- Add underscores to large numeric literals to improve their
167
- readability.
168
- Enabled: false
169
-
170
- # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
171
- # TODO: unclear why this is here! Suggest enabling with
172
- # "EnforcedStyle: compact"
173
- Style/RaiseArgs:
174
- Description: 'Checks the arguments passed to raise/fail.'
175
- Enabled: false
176
-
177
150
  # Analog of: 736b3d295f88b9ba6676fc168b823535582388c2
178
151
  # "Disable opinionated cops"
179
152
  #
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.9.0
4
+ version: 3.10.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-05-11 00:00:00.000000000 Z
11
+ date: 2020-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 0.82.0
33
+ version: 0.83.0
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: 0.82.0
40
+ version: 0.83.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rubocop-rails
43
43
  requirement: !ruby/object:Gem::Requirement