rubocop-govuk 0.2.0 → 3.2.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: 40f84a8c1d1205d4b33bc14effe51e26e365ddca8e51068df0603b9b87d61818
4
- data.tar.gz: e3dd20d13999c8ac7a32b2b6637d65aa7d614943fd8677818543dd171ce46c83
3
+ metadata.gz: 82b9a8a41b6ff232b9f25c7fde4a498c8f6cdf950749a7b6b2174bab4f4239e0
4
+ data.tar.gz: 779bd06389fe70038b21396ddb62e54fdd5e39e21fd6c2047d49db39e5657ae8
5
5
  SHA512:
6
- metadata.gz: e4b2958fe04fb97c2b747fff19dae0659388017a1ca06d5e92b75cbeef7aa8c9547343a22fc62a4acbfde31b75bdbd6ef813dbc41bb8ac511766f98aedf68a71
7
- data.tar.gz: a8947cb7df4765416a3d2ce06de851955151cec7f37d46e78648db00f0c1e4b0b04b08d72205afd5f034475251f507dce49995717153fd8a8b1a89381ad23ce8
6
+ metadata.gz: 68ff798125fe9145572f42d53660e2195d238899bd38a55d384bc735a793ec987e02c579c827a64a1e13592fb99d9a7f92efa3e5eeb195c8cda830eb648989d8
7
+ data.tar.gz: 72549606aec583281a87915192229543ad5e4c0eb405ca710e08142471ffdfb70ee646474000d3a50cc9321a69d2f24a034413d38999de19adc4b02db2353065
@@ -1,3 +1,29 @@
1
+ # 3.2.0
2
+
3
+ * Configure new cops about hash styles (#24)
4
+ * Exclude `tmp` directory from linting checks (#22)
5
+
6
+ # 3.1.0
7
+
8
+ * Fix deprecation warning for AllCops/Excludes => AllCops/Exclude (#17)
9
+ * Exclude `config.ru` from linter checks (#18)
10
+
11
+ # 3.0.0
12
+
13
+ * Update Rubocop to 0.80.1
14
+ * This deletes the Style/BracesAroundHashParameters cop for future
15
+ Ruby 3 compatibility.
16
+ * Exclude `bin` directory and `db/schema.rb` from linter checks (#14)
17
+
18
+ # 2.0.0
19
+
20
+ * Use specific version for RuboCop
21
+ * Update RuboCop to 0.77
22
+
23
+ # 1.0.0
24
+
25
+ * Allow importing of Ruby and Rails rules seperately
26
+
1
27
  # 0.2.0
2
28
 
3
29
  * Disable the Style/FormatStringToken cop
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: config/all.yml
28
+ rubocop-govuk:
29
+ - config/default.yml
30
+ - config/rails.yml
18
31
  ```
19
32
 
20
33
  ## Usage
@@ -1,4 +1,9 @@
1
1
  AllCops:
2
+ Exclude:
3
+ - 'bin/**'
4
+ - 'config.ru'
5
+ - 'tmp/**'
6
+
2
7
  DisplayCopNames:
3
8
  Description: 'Display cop names in offense messages'
4
9
  Enabled: true
@@ -11,12 +16,9 @@ AllCops:
11
16
  Description: 'Display style guide URLs in offense messages.'
12
17
  Enabled: true
13
18
 
14
- require: rubocop-rails
15
-
16
19
  inherit_from:
17
20
  - gds-ruby-styleguide.yml
18
21
  - other-lint.yml
19
- - other-rails.yml
20
22
  - other-style.yml
21
23
  - other-metrics.yml
22
24
  - other-excludes.yml
@@ -55,7 +55,7 @@ Layout/IndentationConsistency:
55
55
  Description: Keep indentation straight.
56
56
  Enabled: true
57
57
 
58
- Metrics/LineLength:
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/TrailingBlankLines:
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
- Whitelist:
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/AlignArray:
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/StringConversionInInterpolation:
326
+ Lint/RedundantStringCoercion:
327
327
  Description: Checks for Object#to_s usage in string interpolation.
328
328
  Enabled: true
329
329
 
@@ -46,7 +46,7 @@ Security/Eval:
46
46
  Description: 'The use of eval represents a serious security risk.'
47
47
  Enabled: true
48
48
 
49
- Lint/HandleExceptions:
49
+ Lint/SuppressedException:
50
50
  Description: "Don't suppress exception."
51
51
  Enabled: true
52
52
 
@@ -11,13 +11,13 @@ Style/Alias:
11
11
  Description: 'Use alias_method instead of alias.'
12
12
  Enabled: false
13
13
 
14
- Layout/AlignHash:
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/AlignParameters:
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/IndentFirstArrayElement:
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/IndentFirstHashElement:
173
+ Layout/FirstHashElementIndentation:
178
174
  Description: 'Checks the indentation of the first key in a hash literal.'
179
175
  Enabled: false
180
176
 
@@ -384,3 +380,12 @@ Style/WhileUntilModifier:
384
380
 
385
381
  Style/FrozenStringLiteralComment:
386
382
  Enabled: false
383
+
384
+ Style/HashEachMethods:
385
+ Enabled: true
386
+
387
+ Style/HashTransformKeys:
388
+ Enabled: true
389
+
390
+ Style/HashTransformValues:
391
+ Enabled: true
@@ -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: false
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: 0.2.0
4
+ version: 3.2.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: 2019-11-04 00:00:00.000000000 Z
11
+ date: 2020-03-12 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: '12.0'
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: '12.0'
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: '0.76'
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: '0.76'
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/all.yml
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