boxt_ruby_style_guide 5.0.0 → 7.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +32 -9
- data/Rakefile +4 -5
- data/VERSION +1 -1
- data/default.yml +9 -28
- data/pending.yml +92 -0
- data/rails.yml +44 -0
- metadata +27 -39
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d777a4f71c363fb460677f819ace6d3fc2a7854be28c0f879f55dc9a7c5fc06
|
4
|
+
data.tar.gz: e6799780986e824dc58bd84b26043b0b8172a61d9e1a75997f6d2e190bf85902
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 728f6d404c97ad1bf6a7fb3b7aa9fb195b528bab33f62695a0383125a246bdcc7ebac3ad90873e3b61332d0dfad25601631be436987c17aa4ecc5b7059fc50c3
|
7
|
+
data.tar.gz: 5a4197428dd85ea2340e4b510c045baaf182adb35841b2a8ec0dfa07ed3b92e727ce2289b933b8cb35d0820d9bfd0c270533990e20df6cf9f0fb2dba04e48ec1
|
data/README.md
CHANGED
@@ -35,17 +35,40 @@ Rails apps should have access to the lint tasks by default.
|
|
35
35
|
|
36
36
|
## Usage
|
37
37
|
|
38
|
-
### Rubocop Config
|
39
|
-
|
40
38
|
Add a `.rubocop.yml` file to the root of your project with the following settings:
|
41
39
|
|
42
40
|
```yml
|
43
41
|
inherit_gem:
|
44
|
-
|
45
|
-
- default.yml
|
42
|
+
boxt_ruby_style_guide:
|
43
|
+
- default.yml # use default cops
|
44
|
+
- pending.yml # use pending cops
|
45
|
+
- rails.yml # use Rails cops - see Additional Extensions/Cops
|
46
|
+
- rails-pending.yml # use pending rails cops
|
47
|
+
- rspec.yml # use rspec cops
|
48
|
+
```
|
49
|
+
|
50
|
+
### Additional Extensions/Cops
|
51
|
+
|
52
|
+
The following Rubocop gems are also installed with this gem:
|
53
|
+
|
54
|
+
* [rubocop-faker](https://github.com/koic/rubocop-faker)
|
55
|
+
* [rubocop-rails](https://github.com/rubocop-hq/rubocop-rails)
|
56
|
+
* [rubocop-rspec](https://github.com/rubocop-hq/rubocop-rspec)
|
57
|
+
|
58
|
+
To enable add the following to your `.rubocop.yml` file.
|
59
|
+
|
60
|
+
```yml
|
61
|
+
inherit_gem:
|
62
|
+
boxt_ruby_style_guide:
|
63
|
+
# .... add cops
|
64
|
+
|
65
|
+
require:
|
66
|
+
- rubocop-faker # if your project is using the Faker gem then add this
|
67
|
+
- rubocop-rails # if your project is a Rails app/engine then add this, plus the - rails.yml setting above
|
68
|
+
- rubocop-rspec # if your project is using rspec then add this, plus the - rspec.yml setting above
|
46
69
|
```
|
47
70
|
|
48
|
-
|
71
|
+
## Lint Tasks
|
49
72
|
|
50
73
|
Lint tasks to run against files listed as changed by Git.
|
51
74
|
|
@@ -57,20 +80,20 @@ rake lint:rubocop
|
|
57
80
|
|
58
81
|
If there are no changed files the commands will run against all files.
|
59
82
|
|
60
|
-
|
83
|
+
## Editor Plugins
|
61
84
|
|
62
85
|
There are also some useful Rubocop editor plugins to help with in-editor linting.
|
63
86
|
|
64
|
-
|
87
|
+
### Atom
|
65
88
|
|
66
89
|
- [linter-rubocop](https://atom.io/packages/linter-rubocop)
|
67
90
|
- [rubocop-auto-correct](https://atom.io/packages/rubocop-auto-correct)
|
68
91
|
|
69
|
-
|
92
|
+
### RubyMine
|
70
93
|
|
71
94
|
- [rubocop](https://www.jetbrains.com/help/ruby/rubocop.html)
|
72
95
|
|
73
|
-
|
96
|
+
### VSCode
|
74
97
|
|
75
98
|
- [ruby-rubocop](https://marketplace.visualstudio.com/items?itemName=misogi.ruby-rubocop)
|
76
99
|
|
data/Rakefile
CHANGED
@@ -2,13 +2,12 @@
|
|
2
2
|
|
3
3
|
require "bundler/gem_tasks"
|
4
4
|
require "rake/testtask"
|
5
|
+
require "rspec/core/rake_task"
|
5
6
|
|
6
7
|
import "./tasks/lint.rake"
|
7
8
|
|
8
|
-
|
9
|
-
t.
|
10
|
-
t.libs << "lib"
|
11
|
-
t.test_files = FileList["test/**/*_test.rb"]
|
9
|
+
RSpec::Core::RakeTask.new(:spec) do |t|
|
10
|
+
t.pattern = Dir.glob("spec/**/*_spec.rb")
|
12
11
|
end
|
13
12
|
|
14
|
-
task
|
13
|
+
task test: :spec
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
7.0.1
|
data/default.yml
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
AllCops:
|
2
2
|
TargetRubyVersion: 2.7.1
|
3
|
+
Exclude:
|
4
|
+
- "**/*/schema.rb"
|
5
|
+
- "Gemfile.lock"
|
6
|
+
- "node_modules/**/*"
|
7
|
+
- "tmp/**/*"
|
8
|
+
- "vendor/**/*"
|
3
9
|
Layout/LineLength:
|
4
10
|
Max: 120 # Increase line length to 120
|
5
11
|
Exclude:
|
@@ -9,12 +15,15 @@ Metrics/BlockLength:
|
|
9
15
|
- "*.gemspec"
|
10
16
|
- "Gemfile"
|
11
17
|
- "config/routes.rb"
|
18
|
+
- "specs/**/*"
|
12
19
|
- "test/**/*"
|
13
20
|
Metrics/ClassLength:
|
14
21
|
Exclude:
|
22
|
+
- "specs/**/*"
|
15
23
|
- "test/**/*"
|
16
24
|
Metrics/MethodLength:
|
17
25
|
Exclude:
|
26
|
+
- "specs/**/*"
|
18
27
|
- "test/**/*"
|
19
28
|
Style/DoubleNegation:
|
20
29
|
Enabled: false
|
@@ -22,31 +31,3 @@ Style/Documentation:
|
|
22
31
|
Enabled: false # Disable Style/Documentation because...
|
23
32
|
Style/StringLiterals:
|
24
33
|
EnforcedStyle: double_quotes # Use double quotes ALL THE TIME!!!
|
25
|
-
# These cops are currently pending and will be enabled by default at some point, but adding for now to stop Rubocop
|
26
|
-
# complaining...
|
27
|
-
Lint/DeprecatedOpenSSLConstant:
|
28
|
-
Enabled: true
|
29
|
-
Lint/MixedRegexpCaptureTypes:
|
30
|
-
Enabled: true
|
31
|
-
Layout/EmptyLinesAroundAttributeAccessor:
|
32
|
-
Enabled: true
|
33
|
-
Layout/SpaceAroundMethodCallOperator:
|
34
|
-
Enabled: true
|
35
|
-
Lint/RaiseException:
|
36
|
-
Enabled: true
|
37
|
-
Lint/StructNewOverride:
|
38
|
-
Enabled: true
|
39
|
-
Style/ExponentialNotation:
|
40
|
-
Enabled: true
|
41
|
-
Style/HashEachMethods:
|
42
|
-
Enabled: true
|
43
|
-
Style/HashTransformKeys:
|
44
|
-
Enabled: true
|
45
|
-
Style/HashTransformValues:
|
46
|
-
Enabled: true
|
47
|
-
Style/RedundantRegexpCharacterClass:
|
48
|
-
Enabled: true
|
49
|
-
Style/RedundantRegexpEscape:
|
50
|
-
Enabled: true
|
51
|
-
Style/SlicingWithRange:
|
52
|
-
Enabled: true
|
data/pending.yml
ADDED
@@ -0,0 +1,92 @@
|
|
1
|
+
# These cops are currently pending and will be enabled by default at some point, but adding for now to stop Rubocop
|
2
|
+
# or VSCode complaining...
|
3
|
+
Layout/EmptyLinesAroundAttributeAccessor:
|
4
|
+
Enabled: true
|
5
|
+
Layout/SpaceAroundMethodCallOperator:
|
6
|
+
Enabled: true
|
7
|
+
Lint/BinaryOperatorWithIdenticalOperands:
|
8
|
+
Enabled: true
|
9
|
+
Lint/DeprecatedOpenSSLConstant:
|
10
|
+
Enabled: true
|
11
|
+
Lint/DuplicateElsifCondition:
|
12
|
+
Enabled: true
|
13
|
+
Lint/DuplicateRequire:
|
14
|
+
Enabled: true
|
15
|
+
Lint/DuplicateRescueException:
|
16
|
+
Enabled: true
|
17
|
+
Lint/EmptyConditionalBody:
|
18
|
+
Enabled: true
|
19
|
+
Lint/EmptyFile:
|
20
|
+
Enabled: true
|
21
|
+
Lint/FloatComparison:
|
22
|
+
Enabled: true
|
23
|
+
Lint/MissingSuper:
|
24
|
+
Enabled: true
|
25
|
+
Lint/MixedRegexpCaptureTypes:
|
26
|
+
Enabled: true
|
27
|
+
Lint/OutOfRangeRegexpRef:
|
28
|
+
Enabled: true
|
29
|
+
Lint/RaiseException:
|
30
|
+
Enabled: true
|
31
|
+
Lint/SelfAssignment:
|
32
|
+
Enabled: true
|
33
|
+
Lint/StructNewOverride:
|
34
|
+
Enabled: true
|
35
|
+
Lint/TopLevelReturnWithArgument:
|
36
|
+
Enabled: true
|
37
|
+
Lint/TrailingCommaInAttributeDeclaration:
|
38
|
+
Enabled: true
|
39
|
+
Lint/UnreachableLoop:
|
40
|
+
Enabled: true
|
41
|
+
Lint/UselessMethodDefinition:
|
42
|
+
Enabled: true
|
43
|
+
Style/AccessorGrouping:
|
44
|
+
Enabled: true
|
45
|
+
Style/ArrayCoercion:
|
46
|
+
Enabled: true
|
47
|
+
Style/BisectedAttrAccessor:
|
48
|
+
Enabled: true
|
49
|
+
Style/CaseLikeIf:
|
50
|
+
Enabled: true
|
51
|
+
Style/CombinableLoops:
|
52
|
+
Enabled: true
|
53
|
+
Style/ExplicitBlockArgument:
|
54
|
+
Enabled: true
|
55
|
+
Style/ExponentialNotation:
|
56
|
+
Enabled: true
|
57
|
+
Style/GlobalStdStream:
|
58
|
+
Enabled: true
|
59
|
+
Style/HashAsLastArrayItem:
|
60
|
+
Enabled: true
|
61
|
+
Style/HashEachMethods:
|
62
|
+
Enabled: true
|
63
|
+
Style/HashLikeCase:
|
64
|
+
Enabled: true
|
65
|
+
Style/HashTransformKeys:
|
66
|
+
Enabled: true
|
67
|
+
Style/HashTransformValues:
|
68
|
+
Enabled: true
|
69
|
+
Style/KeywordParametersOrder:
|
70
|
+
Enabled: true
|
71
|
+
Style/OptionalBooleanParameter:
|
72
|
+
Enabled: true
|
73
|
+
Style/RedundantAssignment:
|
74
|
+
Enabled: true
|
75
|
+
Style/RedundantFetchBlock:
|
76
|
+
Enabled: true
|
77
|
+
Style/RedundantFileExtensionInRequire:
|
78
|
+
Enabled: true
|
79
|
+
Style/RedundantRegexpCharacterClass:
|
80
|
+
Enabled: true
|
81
|
+
Style/RedundantRegexpEscape:
|
82
|
+
Enabled: true
|
83
|
+
Style/RedundantSelfAssignment:
|
84
|
+
Enabled: true
|
85
|
+
Style/SingleArgumentDig:
|
86
|
+
Enabled: true
|
87
|
+
Style/SlicingWithRange:
|
88
|
+
Enabled: true
|
89
|
+
Style/SoleNestedConditional:
|
90
|
+
Enabled: true
|
91
|
+
Style/StringConcatenation:
|
92
|
+
Enabled: true
|
data/rails.yml
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
# Rails specific cops
|
2
|
+
Rails/ApplicationController:
|
3
|
+
Exclude:
|
4
|
+
- "spec/**/*"
|
5
|
+
- "test/**/*"
|
6
|
+
Rails/SkipsModelValidations:
|
7
|
+
Exclude:
|
8
|
+
- "db/migrate/**/*"
|
9
|
+
- "lib/tasks/**/*"
|
10
|
+
- "spec/**/*"
|
11
|
+
- "test/**/*"
|
12
|
+
|
13
|
+
# These rails cops are currently pending and will be enabled by default at some point, but adding for now to stop
|
14
|
+
# Rubocop or VSCode complaining...
|
15
|
+
Rails/ActiveRecordCallbacksOrder:
|
16
|
+
Enabled: true
|
17
|
+
Rails/AfterCommitOverride:
|
18
|
+
Enabled: true
|
19
|
+
Rails/FindById:
|
20
|
+
Enabled: true
|
21
|
+
Rails/Inquiry:
|
22
|
+
Enabled: true
|
23
|
+
Rails/MailerName:
|
24
|
+
Enabled: true
|
25
|
+
Rails/MatchRoute:
|
26
|
+
Enabled: true
|
27
|
+
Rails/NegateInclude:
|
28
|
+
Enabled: true
|
29
|
+
Rails/Pluck:
|
30
|
+
Enabled: true
|
31
|
+
Rails/PluckInWhere:
|
32
|
+
Enabled: true
|
33
|
+
Rails/RenderInline:
|
34
|
+
Enabled: true
|
35
|
+
Rails/RenderPlainText:
|
36
|
+
Enabled: true
|
37
|
+
Rails/ShortI18n:
|
38
|
+
Enabled: true
|
39
|
+
Rails/SquishedSQLHeredocs:
|
40
|
+
Enabled: true
|
41
|
+
Rails/WhereExists:
|
42
|
+
Enabled: true
|
43
|
+
Rails/WhereNot:
|
44
|
+
Enabled: true
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: boxt_ruby_style_guide
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 7.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Boxt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 0.90.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:
|
26
|
+
version: 0.90.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rubocop-faker
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -39,89 +39,75 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: rubocop-rails
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '2.
|
48
|
-
type: :
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '2.1'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: minitest
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '5.14'
|
62
|
-
type: :development
|
47
|
+
version: '2.6'
|
48
|
+
type: :runtime
|
63
49
|
prerelease: false
|
64
50
|
version_requirements: !ruby/object:Gem::Requirement
|
65
51
|
requirements:
|
66
52
|
- - "~>"
|
67
53
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
54
|
+
version: '2.6'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
56
|
+
name: rubocop-rspec
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
72
58
|
requirements:
|
73
59
|
- - "~>"
|
74
60
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
76
|
-
type: :
|
61
|
+
version: '1.43'
|
62
|
+
type: :runtime
|
77
63
|
prerelease: false
|
78
64
|
version_requirements: !ruby/object:Gem::Requirement
|
79
65
|
requirements:
|
80
66
|
- - "~>"
|
81
67
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
68
|
+
version: '1.43'
|
83
69
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
70
|
+
name: bundler
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
86
72
|
requirements:
|
87
73
|
- - "~>"
|
88
74
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
75
|
+
version: '2.1'
|
90
76
|
type: :development
|
91
77
|
prerelease: false
|
92
78
|
version_requirements: !ruby/object:Gem::Requirement
|
93
79
|
requirements:
|
94
80
|
- - "~>"
|
95
81
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
82
|
+
version: '2.1'
|
97
83
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
84
|
+
name: rake
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|
100
86
|
requirements:
|
101
87
|
- - "~>"
|
102
88
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
89
|
+
version: '13.0'
|
104
90
|
type: :development
|
105
91
|
prerelease: false
|
106
92
|
version_requirements: !ruby/object:Gem::Requirement
|
107
93
|
requirements:
|
108
94
|
- - "~>"
|
109
95
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
96
|
+
version: '13.0'
|
111
97
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
98
|
+
name: rspec-nc
|
113
99
|
requirement: !ruby/object:Gem::Requirement
|
114
100
|
requirements:
|
115
101
|
- - "~>"
|
116
102
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
103
|
+
version: '0.3'
|
118
104
|
type: :development
|
119
105
|
prerelease: false
|
120
106
|
version_requirements: !ruby/object:Gem::Requirement
|
121
107
|
requirements:
|
122
108
|
- - "~>"
|
123
109
|
- !ruby/object:Gem::Version
|
124
|
-
version: '
|
110
|
+
version: '0.3'
|
125
111
|
- !ruby/object:Gem::Dependency
|
126
112
|
name: simplecov
|
127
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -152,6 +138,8 @@ files:
|
|
152
138
|
- lib/boxt_ruby_style_guide.rb
|
153
139
|
- lib/boxt_ruby_style_guide/railtie.rb
|
154
140
|
- lib/boxt_ruby_style_guide/version.rb
|
141
|
+
- pending.yml
|
142
|
+
- rails.yml
|
155
143
|
homepage: https://github.com/boxt/ruby-style-guide
|
156
144
|
licenses:
|
157
145
|
- MIT
|
@@ -164,14 +152,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
164
152
|
requirements:
|
165
153
|
- - ">="
|
166
154
|
- !ruby/object:Gem::Version
|
167
|
-
version: '
|
155
|
+
version: '2.7'
|
168
156
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
169
157
|
requirements:
|
170
158
|
- - ">="
|
171
159
|
- !ruby/object:Gem::Version
|
172
160
|
version: '0'
|
173
161
|
requirements: []
|
174
|
-
rubygems_version: 3.1.
|
162
|
+
rubygems_version: 3.1.4
|
175
163
|
signing_key:
|
176
164
|
specification_version: 4
|
177
165
|
summary: Ruby styleguide info for the BOXT Ruby projects
|