ndr_dev_support 1.2.1 → 1.3.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
  SHA1:
3
- metadata.gz: d05cff14bd3e934da25aa7c61393b21781c2d2b2
4
- data.tar.gz: a5c68805421f5b62c3af2ba7173659e1dff20ac9
3
+ metadata.gz: 5ba6131ef761d1d8b2fb442bd73356f764ddc325
4
+ data.tar.gz: af5629685eee9297d3ac137e8105193b4aa2c370
5
5
  SHA512:
6
- metadata.gz: 20c50dba870dddf9e92c23b9bbddc6b12ede7596a262926bfbd2d6811f2254971a600683e55ce4ac106bf495a7205fd7183e60147777a7d1277f449be297b28a
7
- data.tar.gz: 01de99ac267f20da8a8187f16bac9f2075589a84cf5fd84c34a638647071996fccf314d3dbb3b2b6741481b7f1c9bcba519958ad051ba224adfecb5782e01989
6
+ metadata.gz: 5094045b9d8b7ed2d6ae03459a1cb1e40f771d4136246ec5addc69db103e1add3d478a12e7dbffc4cdb74f8cc3c5b9563e3b82815ca0f31e9c83dbcecd3ce639
7
+ data.tar.gz: 4313585e21ce9e76d2026de9addfacc0e93df926f53216597f1541de1761e31cb3c05c696b69c24c805c8b4e7e10f2a12f45b2d571b17668d0ade0e6dc9a797c
@@ -1,19 +1,83 @@
1
- # By default, would enforce { key: value } rather than { :key => value }.
2
- # AllCops:
3
- # RunRailsCops: true
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
+ AllCops:
8
+ # All cops should ignore files in the following locations:
9
+ Exclude:
10
+ - 'bin/*'
11
+ - 'db/**/*'
12
+ - 'lib/generators/**/templates/*'
13
+ - 'vendor/**/*'
14
+
15
+ # Run the Rails cops by default (-R/--rails not required):
16
+ Rails:
17
+ Enabled: true
18
+
19
+ ##################### Style ##################################
20
+
21
+ # We make use of block comments, e.g. for validation documentation.
22
+ Style/BlockComments:
23
+ Enabled: false
4
24
 
5
- # Multi-line method chaining should be done with trailing dots.
6
25
  Style/DotPosition:
26
+ # Multi-line method chaining should be done with trailing dots.
7
27
  EnforcedStyle: trailing
8
28
 
9
- # ...
10
- LineLength:
11
- Max: 99
29
+ Style/IfUnlessModifier:
30
+ MaxLineLength: 100
31
+
32
+ Style/ModuleFunction:
33
+ # `extend self` has fewer side effects than `module_function`.
34
+ EnforcedStyle: extend_self
35
+
36
+ Style/NumericLiterals:
37
+ Exclude:
38
+ - 'test/**/*.rb'
39
+
40
+ Style/SingleLineBlockParams:
41
+ # Prefer readability of contextually-named variables.
42
+ Enabled: false
43
+
44
+ Style/WhileUntilModifier:
45
+ MaxLineLength: 100
46
+
47
+ ##################### Metrics ##################################
48
+ # NOTE: we bump some metrics by 50%, in recognition of Rubocop's
49
+ # desire to split that which we would consider atomic.
12
50
 
13
- # Relax some of the cops for tests
14
51
  Metrics/ClassLength:
52
+ Max: 150
15
53
  Exclude:
16
54
  - test/**/*.rb
55
+
56
+ Metrics/ModuleLength:
57
+ Max: 150
58
+ Exclude:
59
+ - test/**/*.rb
60
+
61
+ Metrics/CyclomaticComplexity:
62
+ Max: 9
63
+
64
+ Metrics/LineLength:
65
+ Max: 100
66
+ Exclude:
67
+ - test/**/*.rb
68
+
17
69
  Metrics/MethodLength:
70
+ Max: 15
18
71
  Exclude:
19
72
  - test/**/*.rb
73
+
74
+ Metrics/PerceivedComplexity:
75
+ Max: 12
76
+
77
+ ##################### Rails ##################################
78
+
79
+ Rails/ActionFilter:
80
+ # 'action' is the default already; we explicitly list here as Rails 3.x
81
+ # projects will want to override this configuration to use 'filter' instead.
82
+ EnforcedStyle: action
83
+
data/README.md CHANGED
@@ -1,10 +1,11 @@
1
- ## NdrDevSupport [![Build Status](https://travis-ci.org/PublicHealthEngland/ndr_dev_support.svg?branch=master)](https://travis-ci.org/PublicHealthEngland/ndr_dev_support)
1
+ ## NdrDevSupport [![Build Status](https://travis-ci.org/PublicHealthEngland/ndr_dev_support.svg?branch=master)](https://travis-ci.org/PublicHealthEngland/ndr_dev_support) [![Gem Version](https://badge.fury.io/rb/ndr_dev_support.svg)](https://badge.fury.io/rb/ndr_dev_support)
2
2
 
3
3
  This is the Public Health England (PHE) National Disease Registers (NDR) Developer Support ruby gem,
4
4
  providing:
5
5
 
6
- 1. rake tasks to manage code auditing of ruby based projects; and
7
- 2. a rake task to limit Rubocop's output to changed (and related) code.
6
+ 1. rake tasks to manage code auditing of ruby based projects
7
+ 2. rake tasks to limit Rubocop's output to changed (and related) code
8
+ 3. integration testing support, which can be required from a project's `test_helper.rb`
8
9
 
9
10
  ## Installation
10
11
 
@@ -38,9 +39,26 @@ For more details of the audit tasks available, execute:
38
39
 
39
40
  $ rake -T audit
40
41
 
42
+ ### RuboCop configuration
43
+
44
+ ndr_dev_support includes tweaks to the default Ruby Style Guide, to better suit NDR.
45
+ To use this updated style guide from within a project, add the following to top of the project's `.rubocop.yml` file:
46
+
47
+ ```yaml
48
+ inherit_gem:
49
+ ndr_dev_support: .rubocop.yml
50
+ ```
51
+
52
+ In order for these configuration to apply, you will need to invoke RuboCop using Bundler:
53
+
54
+ ```
55
+ $ bundle exec rubocop .
56
+ ```
57
+ ...or use the bundled rake task (see next section).
58
+
41
59
  ### RuboCop filtering
42
60
 
43
- ndr_dev_support provides rake tasks to enable more targeted use of RuboCop, to analyse only relevant code changes:
61
+ ndr_dev_support also provides rake tasks to enable more targeted use of RuboCop, to analyse only relevant code changes:
44
62
  ```
45
63
  $ rake rubocop:diff HEAD
46
64
  $ rake rubocop:diff HEAD~3..HEAD~2
@@ -6,8 +6,8 @@ file safety:
6
6
  safe_revision: c59a45986f8b6d087c8c21b1e889f31f7346da17
7
7
  ".rubocop.yml":
8
8
  comments:
9
- reviewed_by: joshpencheon
10
- safe_revision: e1ead45a8d1fd525f3a39cc4a87e6c0338c6b879
9
+ reviewed_by: timgentry
10
+ safe_revision: 1cc4e768fd872e0776962c50fa220a17ee738558
11
11
  ".travis.yml":
12
12
  comments:
13
13
  reviewed_by: josh.pencheon
@@ -26,8 +26,8 @@ file safety:
26
26
  safe_revision: c59a45986f8b6d087c8c21b1e889f31f7346da17
27
27
  README.md:
28
28
  comments:
29
- reviewed_by: josh.pencheon
30
- safe_revision: 88ac9269eb8f0b44c5920a946708e4715421bcad
29
+ reviewed_by: timgentry
30
+ safe_revision: 337228acefd995d094490b51f554c74aeec69e89
31
31
  Rakefile:
32
32
  comments:
33
33
  reviewed_by: josh.pencheon
@@ -86,8 +86,8 @@ file safety:
86
86
  safe_revision: a55c971cb770a8e5dc4be7ed66663dd5d695fcd1
87
87
  lib/ndr_dev_support/version.rb:
88
88
  comments:
89
- reviewed_by: josh.pencheon
90
- safe_revision: 5ad343255973352fe41a9285ea7234276ebc49ab
89
+ reviewed_by: timgentry
90
+ safe_revision: d34d36104299c4debfd2a02cd1af050fcbbcc3e8
91
91
  lib/tasks/audit_code.rake:
92
92
  comments: Identical to the version reviewed by josh.pencheon when contained within
93
93
  ndr_support
@@ -99,12 +99,12 @@ file safety:
99
99
  safe_revision: 41cf1558f567928faaa1e670a36d941c03c78044
100
100
  ndr_dev_support.gemspec:
101
101
  comments:
102
- reviewed_by: josh.pencheon
103
- safe_revision: 88ac9269eb8f0b44c5920a946708e4715421bcad
102
+ reviewed_by: timgentry
103
+ safe_revision: 73f74aa9091f21a153a0e9ba140aedbc7b94da90
104
104
  test/ndr_dev_support_test.rb:
105
105
  comments:
106
106
  reviewed_by: timgentry
107
- safe_revision: c59a45986f8b6d087c8c21b1e889f31f7346da17
107
+ safe_revision: 26a8907a7a8a6b0d836aa12ca0335fa40be12240
108
108
  test/test_helper.rb:
109
109
  comments:
110
110
  reviewed_by: timgentry
@@ -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 = '1.2.1'.freeze
5
+ VERSION = '1.3.0'.freeze
6
6
  end
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
21
21
  spec.required_ruby_version = '>= 2.2'
22
22
 
23
23
  # Rubocop dependencies:
24
- spec.add_dependency 'rubocop', '0.36.0'
24
+ spec.add_dependency 'rubocop', '0.44.0'
25
25
  spec.add_dependency 'parser'
26
26
  spec.add_dependency 'rainbow'
27
27
 
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: 1.2.1
4
+ version: 1.3.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: 2016-07-11 00:00:00.000000000 Z
11
+ date: 2016-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.36.0
19
+ version: 0.44.0
20
20
  type: :runtime
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: 0.36.0
26
+ version: 0.44.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: parser
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -202,7 +202,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
202
202
  version: '0'
203
203
  requirements: []
204
204
  rubyforge_project:
205
- rubygems_version: 2.6.5
205
+ rubygems_version: 2.5.1
206
206
  signing_key:
207
207
  specification_version: 4
208
208
  summary: NDR Developer Support library