ndr_dev_support 1.2.1 → 1.3.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 +4 -4
- data/.rubocop.yml +72 -8
- data/README.md +22 -4
- data/code_safety.yml +9 -9
- data/lib/ndr_dev_support/version.rb +1 -1
- data/ndr_dev_support.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ba6131ef761d1d8b2fb442bd73356f764ddc325
|
4
|
+
data.tar.gz: af5629685eee9297d3ac137e8105193b4aa2c370
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5094045b9d8b7ed2d6ae03459a1cb1e40f771d4136246ec5addc69db103e1add3d478a12e7dbffc4cdb74f8cc3c5b9563e3b82815ca0f31e9c83dbcecd3ce639
|
7
|
+
data.tar.gz: 4313585e21ce9e76d2026de9addfacc0e93df926f53216597f1541de1761e31cb3c05c696b69c24c805c8b4e7e10f2a12f45b2d571b17668d0ade0e6dc9a797c
|
data/.rubocop.yml
CHANGED
@@ -1,19 +1,83 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
#
|
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
|
-
|
11
|
-
|
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 [](https://travis-ci.org/PublicHealthEngland/ndr_dev_support)
|
1
|
+
## NdrDevSupport [](https://travis-ci.org/PublicHealthEngland/ndr_dev_support) [](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
|
7
|
-
2.
|
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
|
data/code_safety.yml
CHANGED
@@ -6,8 +6,8 @@ file safety:
|
|
6
6
|
safe_revision: c59a45986f8b6d087c8c21b1e889f31f7346da17
|
7
7
|
".rubocop.yml":
|
8
8
|
comments:
|
9
|
-
reviewed_by:
|
10
|
-
safe_revision:
|
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:
|
30
|
-
safe_revision:
|
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:
|
90
|
-
safe_revision:
|
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:
|
103
|
-
safe_revision:
|
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:
|
107
|
+
safe_revision: 26a8907a7a8a6b0d836aa12ca0335fa40be12240
|
108
108
|
test/test_helper.rb:
|
109
109
|
comments:
|
110
110
|
reviewed_by: timgentry
|
data/ndr_dev_support.gemspec
CHANGED
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.
|
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-
|
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.
|
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.
|
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.
|
205
|
+
rubygems_version: 2.5.1
|
206
206
|
signing_key:
|
207
207
|
specification_version: 4
|
208
208
|
summary: NDR Developer Support library
|