ndr_dev_support 5.4.8 → 5.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 56da4da690a220d64f0cdbc7ae4be4a4f4f7342d4e46ab8964c48224c95c8ce0
4
- data.tar.gz: 9338de8d07f2c938895f9fb6e31c7d4aceddd7f2551ae4fef4b61d678d0fac1b
3
+ metadata.gz: 266a4e4e0fe8d5aaf551ce205b4d699aec39922d634c34a922cdf825b2e38f0d
4
+ data.tar.gz: 1f07112de5ce4ecb8e18aa1b9a2013bd71d6b99e4442aeb27b8a239928242d0b
5
5
  SHA512:
6
- metadata.gz: 06bae4cb67f71d45e020e0bba1f1aca560ee9f2722f46407d5b7fd0c6a703e8d5a4e79c8c4b8d73c7233ac3b5c55405e63acf788e8dde396932a530db6c90ad4
7
- data.tar.gz: a113098d8df517ed19b967dc53d4ae8c75fbe3fd5c3a207f5bc6a951c81b135b2700e9dfc704394730b82a7618118dac797fa2a85070380a54f66b7a7f9a5ad0
6
+ metadata.gz: d458bf7e248657f21ae473e6809288f91fd0b71dfa660b8706a199c3f4e74f06a02f850d5a3b3008ec5c7ae03545a3720a3a0917ca84f6c69793c629fe1a65bb
7
+ data.tar.gz: b6d391962ebe0e2c5522c4e60186f8a3c0dce42df2e11c8534db28f8e6838d1390c0910adf67007ffc419dfbbe8ee2f346e02d8c77b49366b950661d571659bb
data/.rubocop.yml CHANGED
@@ -1,138 +1 @@
1
- # This file contains NDR's agreed deviations from the standard Ruby
2
- # Style Guide, the configuration for which can be found here:
3
- # https://github.com/bbatsov/rubocop/blob/master/config/default.yml
4
- #
5
- # See the README for instructions on using in a project.
6
-
7
- require:
8
- - rubocop-rails
9
-
10
- AllCops:
11
- # All cops should ignore files in the following locations:
12
- Exclude:
13
- - 'bin/*'
14
- - 'db/schema.rb'
15
- - 'lib/generators/**/templates/*'
16
- - 'tmp/**/*'
17
- - 'vendor/**/*'
18
-
19
- # Once supported by RuboCop, this will prevent cop-specific Excludes from
20
- # overwriting the AllCops defaults above:
21
- #
22
- # inherit_mode:
23
- # merge:
24
- # - Exclude
25
-
26
- # Run the Rails cops by default (-R/--rails not required):
27
- Rails:
28
- Enabled: true
29
-
30
- ##################### Layout #################################
31
-
32
- Layout/DotPosition:
33
- # Multi-line method chaining should be done with trailing dots.
34
- EnforcedStyle: trailing
35
-
36
- Layout/HashAlignment:
37
- EnforcedColonStyle:
38
- - key
39
- - table
40
- EnforcedHashRocketStyle:
41
- - key
42
- - table
43
-
44
- ##################### Style ##################################
45
-
46
- # We make use of block comments, e.g. for validation documentation.
47
- Style/BlockComments:
48
- Enabled: false
49
-
50
- Style/Documentation:
51
- Exclude:
52
- - 'test/**/*.rb'
53
-
54
- Style/FrozenStringLiteralComment:
55
- # We're not confident enough to make this recommendation everywhere
56
- Enabled: false
57
-
58
- Style/ModuleFunction:
59
- # `extend self` has fewer side effects than `module_function`.
60
- EnforcedStyle: extend_self
61
-
62
- Style/NumericLiterals:
63
- Exclude:
64
- - 'db/migrate/*.rb'
65
- - 'test/**/*.rb'
66
-
67
- Style/YodaCondition:
68
- # Disagree; literals as first argument can guard against accidental assignment.
69
- Enabled: false
70
-
71
- Style/SingleLineBlockParams:
72
- # Prefer readability of contextually-named variables.
73
- Enabled: false
74
-
75
- ##################### Metrics ##################################
76
- # NOTE: we bump some metrics by 50%, in recognition of Rubocop's
77
- # desire to split that which we would consider atomic.
78
-
79
- Metrics/AbcSize:
80
- Max: 23
81
- Exclude:
82
- - 'db/migrate/*.rb'
83
- - 'test/**/*.rb'
84
-
85
- Metrics/BlockLength:
86
- # We're already limiting method size, blocks outside of methods
87
- # can legitimately be long (RuboCop defaults to max: 25 lines).
88
- Enabled: false
89
-
90
- Metrics/ClassLength:
91
- Max: 150
92
- Exclude:
93
- - 'db/migrate/*.rb'
94
- - 'test/**/*.rb'
95
-
96
- Metrics/ModuleLength:
97
- Max: 150
98
- Exclude:
99
- - 'test/**/*.rb'
100
-
101
- Metrics/CyclomaticComplexity:
102
- Max: 9
103
-
104
- Layout/LineLength:
105
- Max: 100
106
- Exclude:
107
- - 'db/migrate/*.rb'
108
- - 'test/**/*.rb'
109
-
110
- Metrics/MethodLength:
111
- Max: 15
112
- Exclude:
113
- - 'db/migrate/*.rb'
114
- - 'test/**/*.rb'
115
-
116
- Metrics/PerceivedComplexity:
117
- Max: 12
118
-
119
- ##################### Rails ##################################
120
-
121
- Rails/ActionFilter:
122
- # 'action' is the default already; we explicitly list here as Rails 3.x
123
- # projects will want to override this configuration to use 'filter' instead.
124
- EnforcedStyle: action
125
-
126
- Rails/DynamicFindBy:
127
- Exclude:
128
- - 'test/integration/**/*.rb'
129
-
130
- Rails/RefuteMethods:
131
- Enabled: false
132
-
133
- Rails/SkipsModelValidations:
134
- # Methods like 'update_column' exist for a reason, and it is the developer's
135
- # responsibilty to understand the behaviour of the code they write; blanket
136
- # avoiding them is not helpful/practical.
137
- Enabled: false
138
-
1
+ require: ndr_dev_support
data/CHANGELOG.md CHANGED
@@ -1,6 +1,9 @@
1
1
  ## [Unreleased]
2
2
  *no unreleased changes*
3
3
 
4
+ ## 5.5.0 / 2020-01-27
5
+ * bundle master RuboCop config, and allow it to be `required`
6
+
4
7
  ## 5.4.8 / 2020-01-24
5
8
  ### Fixed
6
9
  * deploy: insert temporary DB config to allow asset precompilation
data/README.md CHANGED
@@ -49,16 +49,22 @@ For more details of the audit tasks available, execute:
49
49
 
50
50
  ### RuboCop configuration
51
51
 
52
- ndr_dev_support includes tweaks to the default Ruby Style Guide, to better suit NDR.
53
- To use this updated style guide from within a project, add the following to top of the project's `.rubocop.yml` file:
52
+ `ndr_dev_support` includes tweaks to the default Ruby and Ruby on Rails Style Guides, to better suit NDR.
53
+ To use these updated style guides from within a project, add the following to top of the project's `.rubocop.yml` file:
54
54
 
55
55
  ```yaml
56
- inherit_from: 'https://raw.githubusercontent.com/PublicHealthEngland/ndr_dev_support/master/.rubocop.yml'
56
+ require: ndr_dev_support
57
57
  ```
58
58
 
59
- RuboCop also allows `inherit_gem`, but this currently doesn't work with relative paths (paths are deemed relative to the config file, rather than the project including `ndr_dev_support`).
59
+ Or, if using other extensions too:
60
60
 
61
- In order for these configuration to apply, you will need to invoke RuboCop using Bundler:
61
+ ```yaml
62
+ require:
63
+ - ndr_dev_support
64
+ - some_other_extension
65
+ ```
66
+
67
+ In order for these configurations to apply, you will need to invoke RuboCop using Bundler:
62
68
 
63
69
  ```
64
70
  $ bundle exec rubocop .
data/code_safety.yml CHANGED
@@ -11,7 +11,7 @@ file safety:
11
11
  ".rubocop.yml":
12
12
  comments:
13
13
  reviewed_by: josh.pencheon
14
- safe_revision: 83097be1002f924a37fcbd6d9099e08e9ed65621
14
+ safe_revision: 6211cff0ce44645ed3752723b5b0ee65f24c66aa
15
15
  ".travis.yml":
16
16
  comments:
17
17
  reviewed_by: josh.pencheon
@@ -19,7 +19,7 @@ file safety:
19
19
  CHANGELOG.md:
20
20
  comments:
21
21
  reviewed_by: josh.pencheon
22
- safe_revision: 57f7530eb0be94318d40a09a9648ca3df9d7575b
22
+ safe_revision: aa0d11190daa8842da406b933d61c4043823ef9a
23
23
  CODE_OF_CONDUCT.md:
24
24
  comments:
25
25
  reviewed_by: timgentry
@@ -35,7 +35,7 @@ file safety:
35
35
  README.md:
36
36
  comments:
37
37
  reviewed_by: josh.pencheon
38
- safe_revision: dd220d1cd30d878bf8a35495efe474f08c5c0971
38
+ safe_revision: 2cf2b6e3ce2f054289699527c13cd7d795347ce3
39
39
  Rakefile:
40
40
  comments:
41
41
  reviewed_by: josh.pencheon
@@ -48,6 +48,10 @@ file safety:
48
48
  comments:
49
49
  reviewed_by: timgentry
50
50
  safe_revision: c59a45986f8b6d087c8c21b1e889f31f7346da17
51
+ config/rubocop/ndr.yml:
52
+ comments:
53
+ reviewed_by: josh.pencheon
54
+ safe_revision: 6211cff0ce44645ed3752723b5b0ee65f24c66aa
51
55
  gemfiles/Gemfile.rails52:
52
56
  comments:
53
57
  reviewed_by: josh.pencheon
@@ -66,8 +70,8 @@ file safety:
66
70
  safe_revision: 26efe45f35f211e7cb7a04967c51c0b6d116321e
67
71
  lib/ndr_dev_support.rb:
68
72
  comments:
69
- reviewed_by: timgentry
70
- safe_revision: c59a45986f8b6d087c8c21b1e889f31f7346da17
73
+ reviewed_by: josh.pencheon
74
+ safe_revision: 6211cff0ce44645ed3752723b5b0ee65f24c66aa
71
75
  lib/ndr_dev_support/capistrano/assets.rb:
72
76
  comments:
73
77
  reviewed_by: josh.pencheon
@@ -180,6 +184,10 @@ file safety:
180
184
  comments:
181
185
  reviewed_by: josh.pencheon
182
186
  safe_revision: e56876f46536ba006a9b68029306f41a188bf9c6
187
+ lib/ndr_dev_support/rubocop/inject.rb:
188
+ comments:
189
+ reviewed_by: josh.pencheon
190
+ safe_revision: 6211cff0ce44645ed3752723b5b0ee65f24c66aa
183
191
  lib/ndr_dev_support/rubocop/range_augmenter.rb:
184
192
  comments:
185
193
  reviewed_by: joshpencheon
@@ -203,7 +211,7 @@ file safety:
203
211
  lib/ndr_dev_support/version.rb:
204
212
  comments:
205
213
  reviewed_by: josh.pencheon
206
- safe_revision: 57f7530eb0be94318d40a09a9648ca3df9d7575b
214
+ safe_revision: aa0d11190daa8842da406b933d61c4043823ef9a
207
215
  lib/tasks/audit_code.rake:
208
216
  comments: Identical to the version reviewed by josh.pencheon when contained within
209
217
  ndr_support
@@ -0,0 +1,138 @@
1
+ # This file contains NDR's agreed deviations from the standard Ruby
2
+ # Style Guide, the configuration for which can be found here:
3
+ # https://github.com/bbatsov/rubocop/blob/master/config/default.yml
4
+ #
5
+ # See the README for instructions on using in a project.
6
+
7
+ require:
8
+ - rubocop-rails
9
+
10
+ AllCops:
11
+ # All cops should ignore files in the following locations:
12
+ Exclude:
13
+ - 'bin/*'
14
+ - 'db/schema.rb'
15
+ - 'lib/generators/**/templates/*'
16
+ - 'tmp/**/*'
17
+ - 'vendor/**/*'
18
+
19
+ # Once supported by RuboCop, this will prevent cop-specific Excludes from
20
+ # overwriting the AllCops defaults above:
21
+ #
22
+ # inherit_mode:
23
+ # merge:
24
+ # - Exclude
25
+
26
+ # Run the Rails cops by default (-R/--rails not required):
27
+ Rails:
28
+ Enabled: true
29
+
30
+ ##################### Layout #################################
31
+
32
+ Layout/DotPosition:
33
+ # Multi-line method chaining should be done with trailing dots.
34
+ EnforcedStyle: trailing
35
+
36
+ Layout/HashAlignment:
37
+ EnforcedColonStyle:
38
+ - key
39
+ - table
40
+ EnforcedHashRocketStyle:
41
+ - key
42
+ - table
43
+
44
+ ##################### Style ##################################
45
+
46
+ # We make use of block comments, e.g. for validation documentation.
47
+ Style/BlockComments:
48
+ Enabled: false
49
+
50
+ Style/Documentation:
51
+ Exclude:
52
+ - 'test/**/*.rb'
53
+
54
+ Style/FrozenStringLiteralComment:
55
+ # We're not confident enough to make this recommendation everywhere
56
+ Enabled: false
57
+
58
+ Style/ModuleFunction:
59
+ # `extend self` has fewer side effects than `module_function`.
60
+ EnforcedStyle: extend_self
61
+
62
+ Style/NumericLiterals:
63
+ Exclude:
64
+ - 'db/migrate/*.rb'
65
+ - 'test/**/*.rb'
66
+
67
+ Style/YodaCondition:
68
+ # Disagree; literals as first argument can guard against accidental assignment.
69
+ Enabled: false
70
+
71
+ Style/SingleLineBlockParams:
72
+ # Prefer readability of contextually-named variables.
73
+ Enabled: false
74
+
75
+ ##################### Metrics ##################################
76
+ # NOTE: we bump some metrics by 50%, in recognition of Rubocop's
77
+ # desire to split that which we would consider atomic.
78
+
79
+ Metrics/AbcSize:
80
+ Max: 23
81
+ Exclude:
82
+ - 'db/migrate/*.rb'
83
+ - 'test/**/*.rb'
84
+
85
+ Metrics/BlockLength:
86
+ # We're already limiting method size, blocks outside of methods
87
+ # can legitimately be long (RuboCop defaults to max: 25 lines).
88
+ Enabled: false
89
+
90
+ Metrics/ClassLength:
91
+ Max: 150
92
+ Exclude:
93
+ - 'db/migrate/*.rb'
94
+ - 'test/**/*.rb'
95
+
96
+ Metrics/ModuleLength:
97
+ Max: 150
98
+ Exclude:
99
+ - 'test/**/*.rb'
100
+
101
+ Metrics/CyclomaticComplexity:
102
+ Max: 9
103
+
104
+ Layout/LineLength:
105
+ Max: 100
106
+ Exclude:
107
+ - 'db/migrate/*.rb'
108
+ - 'test/**/*.rb'
109
+
110
+ Metrics/MethodLength:
111
+ Max: 15
112
+ Exclude:
113
+ - 'db/migrate/*.rb'
114
+ - 'test/**/*.rb'
115
+
116
+ Metrics/PerceivedComplexity:
117
+ Max: 12
118
+
119
+ ##################### Rails ##################################
120
+
121
+ Rails/ActionFilter:
122
+ # 'action' is the default already; we explicitly list here as Rails 3.x
123
+ # projects will want to override this configuration to use 'filter' instead.
124
+ EnforcedStyle: action
125
+
126
+ Rails/DynamicFindBy:
127
+ Exclude:
128
+ - 'test/integration/**/*.rb'
129
+
130
+ Rails/RefuteMethods:
131
+ Enabled: false
132
+
133
+ Rails/SkipsModelValidations:
134
+ # Methods like 'update_column' exist for a reason, and it is the developer's
135
+ # responsibilty to understand the behaviour of the code they write; blanket
136
+ # avoiding them is not helpful/practical.
137
+ Enabled: false
138
+
@@ -1,5 +1,8 @@
1
+ require 'ndr_dev_support/rubocop/inject'
1
2
  require 'ndr_dev_support/version'
2
3
 
3
4
  module NdrDevSupport
4
- # Your code goes here...
5
+ # Bootstrap our RuboCop config in to any project
6
+ # when ndr_dev_support is required in .rubocop.yml.
7
+ Rubocop::Inject.defaults!
5
8
  end
@@ -0,0 +1,26 @@
1
+ require 'rubocop'
2
+
3
+ module NdrDevSupport
4
+ module Rubocop
5
+ # Following approach of rubocop-hq/rubocop-extension-generator,
6
+ # monkey-patch in default configuration.
7
+ module Inject
8
+ def self.defaults!
9
+ root = Pathname.new(__dir__).parent.parent.parent.expand_path
10
+ path = root.join('config', 'rubocop', 'ndr.yml').to_s
11
+
12
+ # Whereas by default, the raw YAML would be processed, we pass
13
+ # through the ConfigLoader fully - this ensures `require` and
14
+ # `inherit_from` statements are properly evaluated.
15
+ #
16
+ # PR at rubocop-hq/rubocop-extension-generator/pull/9
17
+ #
18
+ config = ::RuboCop::ConfigLoader.load_file(path)
19
+ puts "configuration from \#{path}" if ::RuboCop::ConfigLoader.debug?
20
+
21
+ config = ::RuboCop::ConfigLoader.merge_with_default(config, path)
22
+ ::RuboCop::ConfigLoader.instance_variable_set(:@default_configuration, config)
23
+ end
24
+ end
25
+ end
26
+ end
@@ -2,5 +2,5 @@
2
2
  # This defines the NdrDevSupport version. If you change it, rebuild and commit the gem.
3
3
  # Use "rake build" to build the gem, see rake -T for all bundler rake tasks (and our own).
4
4
  module NdrDevSupport
5
- VERSION = '5.4.8'.freeze
5
+ VERSION = '5.5.0'.freeze
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ndr_dev_support
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.4.8
4
+ version: 5.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - NCRS Development Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-24 00:00:00.000000000 Z
11
+ date: 2020-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -392,6 +392,7 @@ files:
392
392
  - bin/console
393
393
  - bin/setup
394
394
  - code_safety.yml
395
+ - config/rubocop/ndr.yml
395
396
  - gemfiles/Gemfile.rails52
396
397
  - gemfiles/Gemfile.rails60
397
398
  - lib/minitest/rake_ci.rb
@@ -425,6 +426,7 @@ files:
425
426
  - lib/ndr_dev_support/rake_ci/redmine/ticket_resolver.rb
426
427
  - lib/ndr_dev_support/rake_ci/simple_cov_helper.rb
427
428
  - lib/ndr_dev_support/rubocop/executor.rb
429
+ - lib/ndr_dev_support/rubocop/inject.rb
428
430
  - lib/ndr_dev_support/rubocop/range_augmenter.rb
429
431
  - lib/ndr_dev_support/rubocop/range_finder.rb
430
432
  - lib/ndr_dev_support/rubocop/reporter.rb