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.
Files changed (8) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +32 -9
  3. data/Rakefile +4 -5
  4. data/VERSION +1 -1
  5. data/default.yml +9 -28
  6. data/pending.yml +92 -0
  7. data/rails.yml +44 -0
  8. metadata +27 -39
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 990c11d38d6f55aa69736086dd46cd6e3219bf1eca081ee49e53f91dfaef14f8
4
- data.tar.gz: 56a3e58543c52e2a80151e2205a90e765e4d61e48d323a6b2aa0cda824e3278e
3
+ metadata.gz: 5d777a4f71c363fb460677f819ace6d3fc2a7854be28c0f879f55dc9a7c5fc06
4
+ data.tar.gz: e6799780986e824dc58bd84b26043b0b8172a61d9e1a75997f6d2e190bf85902
5
5
  SHA512:
6
- metadata.gz: 379f9970696c4a40c5a832914e5a3fef1d6ee7507ba786d5b8231ad256e9433d352e6d5bec241adb18ce2fd58a2c27136f7883748fca5c66208e382ac5084fdc
7
- data.tar.gz: 37198a5649dcfb1b0a2630403f3194ce7f902ed45c3f600b42f3b2504b22347ce40edd717be5a11a795d19156c32b812df85ab1b2fef86f9b0fa8233dc35baf9
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
- boxt-ruby-style-guide:
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
- ### Lint Tasks
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
- ### Editor Plugins
83
+ ## Editor Plugins
61
84
 
62
85
  There are also some useful Rubocop editor plugins to help with in-editor linting.
63
86
 
64
- #### Atom
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
- #### RubyMine
92
+ ### RubyMine
70
93
 
71
94
  - [rubocop](https://www.jetbrains.com/help/ruby/rubocop.html)
72
95
 
73
- #### VSCode
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
- Rake::TestTask.new(:test) do |t|
9
- t.libs << "test"
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 default: :test
13
+ task test: :spec
data/VERSION CHANGED
@@ -1 +1 @@
1
- 5.0.0
1
+ 7.0.1
@@ -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
@@ -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
@@ -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: 5.0.0
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-06-11 00:00:00.000000000 Z
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: '0.83'
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: '0.83'
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: bundler
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.1'
48
- type: :development
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: '5.14'
54
+ version: '2.6'
69
55
  - !ruby/object:Gem::Dependency
70
- name: minitest-fail-fast
56
+ name: rubocop-rspec
71
57
  requirement: !ruby/object:Gem::Requirement
72
58
  requirements:
73
59
  - - "~>"
74
60
  - !ruby/object:Gem::Version
75
- version: '0.1'
76
- type: :development
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: '0.1'
68
+ version: '1.43'
83
69
  - !ruby/object:Gem::Dependency
84
- name: minitest-macos-notification
70
+ name: bundler
85
71
  requirement: !ruby/object:Gem::Requirement
86
72
  requirements:
87
73
  - - "~>"
88
74
  - !ruby/object:Gem::Version
89
- version: '0.3'
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: '0.3'
82
+ version: '2.1'
97
83
  - !ruby/object:Gem::Dependency
98
- name: minitest-reporters
84
+ name: rake
99
85
  requirement: !ruby/object:Gem::Requirement
100
86
  requirements:
101
87
  - - "~>"
102
88
  - !ruby/object:Gem::Version
103
- version: '1.4'
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: '1.4'
96
+ version: '13.0'
111
97
  - !ruby/object:Gem::Dependency
112
- name: rake
98
+ name: rspec-nc
113
99
  requirement: !ruby/object:Gem::Requirement
114
100
  requirements:
115
101
  - - "~>"
116
102
  - !ruby/object:Gem::Version
117
- version: '13.0'
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: '13.0'
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: '0'
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.2
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