boxt_ruby_style_guide 4.5.0 → 7.0.0

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 +28 -9
  3. data/Rakefile +4 -5
  4. data/VERSION +1 -1
  5. data/default.yml +10 -29
  6. data/pending.yml +92 -0
  7. data/rails.yml +11 -0
  8. metadata +30 -42
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d19f77cc83a82775393531673adf8a9e0e9ea96c3c784b0bfdac197cf0708222
4
- data.tar.gz: b8054560a4926718c76aba4e9f90d7d70667eaf760f95eb2ba1b4abd33029258
3
+ metadata.gz: 1a1cdef5d767b03fba8f47540550acd135fe01b08abf7466f147fb0bdfd94eab
4
+ data.tar.gz: 5ec5348fc0330db43795393fc9a7a1928e9f59f1b960c88486dc8a87f64bce32
5
5
  SHA512:
6
- metadata.gz: 43cd3abbe5fa4e07b1d60232748afc1c594095e8f88b1295c702f6554437680a6b241165f6ca9666d08d61b6607a858e0be35624d0c1555684f94f33045598ab
7
- data.tar.gz: 20de9bad1ffd65cc488f9a51f57fca817ac95515bdba5244934d24ca91829489cc30f8488c15b5d46863d0f06c2efd4025e38a2201ad5e3e959b7af1a6b0bd17
6
+ metadata.gz: 59367ce3b36832a64f0511abf8a457be1e87e20ddcbf09cb9f9601dc09104bea18b34d14305c4bbcaad75714521db16c1896a7ed77aa1d97b0ab8be1dfbd63a9
7
+ data.tar.gz: 0c3f7f550f8c31390cb5fbdc85b1d791ff248ddcaf6583e28fbcb4cc1f15e96c64f104497a5ece6f78dbb8927980b9e612c545150db161e052faaedf5b8d3fb4
data/README.md CHANGED
@@ -35,17 +35,36 @@ 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
+ ```
47
+
48
+ ### Additional Extensions/Cops
49
+
50
+ The following Rubocop gems are also installed with this gem:
51
+
52
+ * [rubocop-faker](https://github.com/koic/rubocop-faker)
53
+ * [rubocop-rails](https://github.com/rubocop-hq/rubocop-rails)
54
+
55
+ To enable add the following to your `.rubocop.yml` file.
56
+
57
+ ```yml
58
+ inherit_gem:
59
+ boxt_ruby_style_guide:
60
+ # .... add cops
61
+
62
+ require:
63
+ - rubocop-faker # if your project is using the Faker gem then add this
64
+ - rubocop-rails # if your project is a Rails app/engine then add this, plus the - rails.yml setting above
46
65
  ```
47
66
 
48
- ### Lint Tasks
67
+ ## Lint Tasks
49
68
 
50
69
  Lint tasks to run against files listed as changed by Git.
51
70
 
@@ -57,20 +76,20 @@ rake lint:rubocop
57
76
 
58
77
  If there are no changed files the commands will run against all files.
59
78
 
60
- ### Editor Plugins
79
+ ## Editor Plugins
61
80
 
62
81
  There are also some useful Rubocop editor plugins to help with in-editor linting.
63
82
 
64
- #### Atom
83
+ ### Atom
65
84
 
66
85
  - [linter-rubocop](https://atom.io/packages/linter-rubocop)
67
86
  - [rubocop-auto-correct](https://atom.io/packages/rubocop-auto-correct)
68
87
 
69
- #### RubyMine
88
+ ### RubyMine
70
89
 
71
90
  - [rubocop](https://www.jetbrains.com/help/ruby/rubocop.html)
72
91
 
73
- #### VSCode
92
+ ### VSCode
74
93
 
75
94
  - [ruby-rubocop](https://marketplace.visualstudio.com/items?itemName=misogi.ruby-rubocop)
76
95
 
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
- 4.5.0
1
+ 7.0.0
@@ -1,5 +1,11 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.7.0
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,11 @@
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/**/*"
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.5.0
4
+ version: 7.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Boxt
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-02 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,11 +138,13 @@ 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
158
146
  metadata: {}
159
- post_install_message:
147
+ post_install_message:
160
148
  rdoc_options: []
161
149
  require_paths:
162
150
  - lib
@@ -164,15 +152,15 @@ 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
175
- signing_key:
162
+ rubygems_version: 3.1.4
163
+ signing_key:
176
164
  specification_version: 4
177
165
  summary: Ruby styleguide info for the BOXT Ruby projects
178
166
  test_files: []