rubocop-govuk 3.14.0 → 3.15.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: 248e60260a8647aef347016c34f825328544408b2d6805dd19b82105570663f1
4
- data.tar.gz: 55966fee3db3a3c27aa56f087629c560dbfd47e6b31945885abce3569c98dc14
3
+ metadata.gz: 1171ad385c38876c2f62430dcb6adaebaaca00ff54e75a6dd8c270d18c09e841
4
+ data.tar.gz: 3575953156d194c6eb0e2bb6b64244862608fd6980df1a8a30668c6eb088ffa5
5
5
  SHA512:
6
- metadata.gz: 927073b5c07e0efd223e2a9d3a1bfe726cbbb09f8592171178efb04f0462d025b25615c4164c856523e53f5746eb62c223225c0a5d6d942a1b4c51402e8d274c
7
- data.tar.gz: d3244ce4fdbbbcd3cbdb3e6ea5076dc84f9fcf662d624fec9b5486214ca2fb4125379d33a5c3b14cbeea4b75b5bedc0030441d77393f1586e0e73d631246aee6
6
+ metadata.gz: 9a76bcf79590b6181faf54c27f19b0674137f78863d2c0a8121291eaa4c4b149e0d239405ed292665b7d6f554eb96d33594aaba6a2ff7508b2b1e0dd3e27c64b
7
+ data.tar.gz: c56adb23766c457038b2a3b9dd4b7f4892258ed309f92d2a2d273ef03fab82c05e4d27b8afcd8c42f2bf962127011dfa619504053dc8f61285231acdd540dc4d
@@ -1,3 +1,9 @@
1
+ # 3.15.0
2
+
3
+ - Remove cops that are RuboCop defaults (#88)
4
+ - Disable Rails/DynamicFindBy
5
+ - Permit "and", "but" with RSpec/ContextWording
6
+
1
7
  # 3.14.0
2
8
 
3
9
  - Disable Rails/InverseOf
data/README.md CHANGED
@@ -11,35 +11,39 @@ Add `rubocop-govuk` to your Gemfile and then run `bundle install`:
11
11
  gem 'rubocop-govuk'
12
12
  ```
13
13
 
14
- Inherit rules from the gem by adding the following to your project's RuboCop config:
14
+ Then inherit the default rules by adding the following in your project:
15
15
 
16
16
  ```yaml
17
17
  # .rubocop.yml
18
18
  inherit_gem:
19
19
  rubocop-govuk:
20
20
  - config/default.yml
21
+
22
+ inherit_mode:
23
+ merge:
24
+ - Exclude
21
25
  ```
22
26
 
23
- or if you also need Rails specific rules:
27
+ You can also configure additional rules for Rails and RSpec:
24
28
 
25
29
  ```yaml
26
30
  # .rubocop.yml
27
31
  inherit_gem:
28
32
  rubocop-govuk:
29
- - config/default.yml
33
+ ...
30
34
  - config/rails.yml
31
-
32
- inherit_mode:
33
- merge:
34
- - Exclude
35
35
  ```
36
36
 
37
- ## Usage
37
+ ```yaml
38
+ # .rubocop.yml
39
+ inherit_gem:
40
+ rubocop-govuk:
41
+ ...
42
+ - config/rspec.yml
43
+ ```
38
44
 
39
- Run RuboCop:
45
+ ## Testing
40
46
 
41
- ```sh
42
- bundle exec rubocop
43
- ```
47
+ Run `bundle exec rake`.
44
48
 
45
49
  [guides]: https://github.com/alphagov/styleguides
@@ -1,10 +1,3 @@
1
- # Part of the orignal GDS styleguide
2
- # "Use empty lines between defs and to break up a method into logical paragraphs."
3
- # https://github.com/alphagov/styleguides/blob/6395a10d41c3938f4c147cda443fd83f854c3e7a/ruby.md#general
4
- Layout/EmptyLineBetweenDefs:
5
- Enabled: true
6
- AllowAdjacentOneLineDefs: false
7
-
8
1
  # https://github.com/alphagov/govuk-lint/pull/7
9
2
  # "There are occasions where following this rule forces you to make the
10
3
  # code less readable. This is particularly the case for tests where method
@@ -13,6 +13,17 @@ AllCops:
13
13
  Rails:
14
14
  Enabled: true
15
15
 
16
+ # We have custom find_by methods in several repos, which
17
+ # we're not going to rename. This Cop also raises false
18
+ # positives for find_by methods that are unrelated to model
19
+ # classes, as well as for repos using Mongoid. The value
20
+ # of the consistency this brings is limited, since we mostly
21
+ # use find_by(key: value) anyway.
22
+ #
23
+ # https://github.com/rubocop-hq/rubocop/issues/3758
24
+ Rails/DynamicFindBy:
25
+ Enabled: false
26
+
16
27
  # We commonly print output in Ruby code that has been
17
28
  # extracted from a Rake task in 'lib/'.
18
29
  Rails/Output:
@@ -35,3 +35,13 @@ RSpec/MessageSpies:
35
35
  # it's not clear what action to take to fix an issue.
36
36
  RSpec/NestedGroups:
37
37
  Enabled: false
38
+
39
+ # Nested contexts make more sense with "and" or "but", since
40
+ # they are a refinement of an outer context.
41
+ RSpec/ContextWording:
42
+ Prefixes:
43
+ - when
44
+ - with
45
+ - without
46
+ - and
47
+ - but
@@ -13,20 +13,6 @@ Style/IfUnlessModifier:
13
13
  Style/MethodCalledOnDoEndBlock:
14
14
  Enabled: true
15
15
 
16
- # Part of the orignal GDS styleguide
17
- # "Omit the parentheses when the method doesn’t accept any arguments"
18
- # https://github.com/alphagov/styleguides/blob/6395a10d41c3938f4c147cda443fd83f854c3e7a/ruby.md#syntax
19
- Style/MethodCallWithoutArgsParentheses:
20
- Enabled: true
21
-
22
- # Part of the orignal GDS styleguide
23
- # "Use Ruby 1.9 syntax for symbolic hash keys.
24
- # This includes method calls."
25
- # https://github.com/alphagov/styleguides/blob/6395a10d41c3938f4c147cda443fd83f854c3e7a/ruby.md#collections
26
- Style/HashSyntax:
27
- Exclude:
28
- - 'db/schema.rb'
29
-
30
16
  # Part of the orignal GDS styleguide
31
17
  # "Add a trailing comma to multi-line array [...]
32
18
  # for clearer diffs with less line noise."
@@ -153,11 +139,6 @@ Style/RegexpLiteral:
153
139
  Style/SafeNavigation:
154
140
  Enabled: false
155
141
 
156
- # We should allow for single line empty methods, as this
157
- # is a convention for Rails controller actions.
158
- Style/SingleLineMethods:
159
- AllowIfMethodIsEmpty: true
160
-
161
142
  # Introduced in: b171d652d3e434b74ddc621df3b5be24c49bc7e8
162
143
  # This cop was added in preperation for a Ruby feature
163
144
  # that is no longer likely to become part of the language.
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.14.0
4
+ version: 3.15.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-22 00:00:00.000000000 Z
11
+ date: 2020-06-04 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.83.0
33
+ version: 0.85.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.83.0
40
+ version: 0.85.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rubocop-rails
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
118
  - !ruby/object:Gem::Version
119
119
  version: '0'
120
120
  requirements: []
121
- rubygems_version: 3.1.3
121
+ rubygems_version: 3.1.4
122
122
  signing_key:
123
123
  specification_version: 4
124
124
  summary: RuboCop GOV.UK