Dutchie-Style 2.0.7 → 2.0.11
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/Dutchie-Style.gemspec +20 -12
- data/Gemfile +1 -1
- data/Gemfile.lock +42 -31
- data/README.md +3 -1
- data/config/default.yml +303 -0
- data/lib/Dutchie/Style/version.rb +2 -1
- data/lib/Dutchie/Style.rb +12 -1
- data/lib/dutchie-style.rb +3 -0
- data/{default.yml → old-default.yml} +4 -5
- metadata +61 -19
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 98940de414a26efc09108619c8421782a09bf51c25032a357e854856aaaa6505
|
|
4
|
+
data.tar.gz: f6b9595bbf810983571ab1d531c0fb5d441ddb126e495df7d993c6bbd30ff398
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 82715d41789f44683bf8a58f6ec92f18d17ef50c00e9d13e994f5a3dc9f5b4fdfc606d2adcc35870568059a302c7ba1053356446c68ca69678f675d360c14ee6
|
|
7
|
+
data.tar.gz: f05a26ac206b58de4b1e35777776fcb67e6a7578608c63e42e8cadd62fb386df722792146eb7ee69c3ffc2e44d083395f8f3c05cf238a3a4a3fb8d18ac661c91
|
data/Dutchie-Style.gemspec
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "lib/Dutchie/Style/version"
|
|
2
4
|
|
|
3
5
|
Gem::Specification.new do |spec|
|
|
4
6
|
spec.name = "Dutchie-Style"
|
|
@@ -6,12 +8,12 @@ Gem::Specification.new do |spec|
|
|
|
6
8
|
spec.authors = ["Christopher Ostrowski"]
|
|
7
9
|
spec.email = ["chris@dutchie.com"]
|
|
8
10
|
|
|
9
|
-
spec.license =
|
|
11
|
+
spec.license = "MIT"
|
|
10
12
|
|
|
11
|
-
spec.summary =
|
|
12
|
-
spec.description =
|
|
13
|
+
spec.summary = "Rubocop Settings for all dutchie Ruby Apps"
|
|
14
|
+
spec.description = "Rubocop Settings for all dutchie Ruby Apps"
|
|
13
15
|
spec.homepage = "https://github.com/GetDutchie/Dutchie-Style"
|
|
14
|
-
spec.required_ruby_version = Gem::Requirement.new(">=
|
|
16
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 3.1.4")
|
|
15
17
|
|
|
16
18
|
spec.metadata["homepage_uri"] = spec.homepage
|
|
17
19
|
spec.metadata["source_code_uri"] = "https://github.com/GetDutchie/Dutchie-Style"
|
|
@@ -19,14 +21,20 @@ Gem::Specification.new do |spec|
|
|
|
19
21
|
|
|
20
22
|
# Specify which files should be added to the gem when it is released.
|
|
21
23
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
22
|
-
spec.files
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
spec.files =
|
|
25
|
+
Dir.chdir(File.expand_path(__dir__)) do
|
|
26
|
+
`git ls-files -z`.split("\x0").reject {|f| f.match(%r{^(test|spec|features)/}) }
|
|
27
|
+
end
|
|
25
28
|
spec.bindir = "exe"
|
|
26
|
-
spec.executables = spec.files.grep(%r{^exe/}) {
|
|
29
|
+
spec.executables = spec.files.grep(%r{^exe/}) {|f| File.basename(f) }
|
|
27
30
|
spec.require_paths = ["lib"]
|
|
28
31
|
|
|
29
|
-
spec.add_dependency "rubocop", "~> 1.
|
|
30
|
-
spec.add_dependency "rubocop-
|
|
31
|
-
spec.add_dependency "rubocop-
|
|
32
|
+
spec.add_dependency "rubocop", "~> 1.72"
|
|
33
|
+
spec.add_dependency "rubocop-capybara", "~> 2.18"
|
|
34
|
+
spec.add_dependency "rubocop-factory_bot", "~> 2.24"
|
|
35
|
+
spec.add_dependency "rubocop-rails", "~> 2.21"
|
|
36
|
+
spec.add_dependency "rubocop-rspec", "~> 2.24"
|
|
37
|
+
spec.add_dependency "rubocop-rspec_rails", "~> 2.25"
|
|
38
|
+
|
|
39
|
+
spec.metadata["rubygems_mfa_required"] = "true"
|
|
32
40
|
end
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
Dutchie-Style (2.0.
|
|
5
|
-
rubocop (~> 1.
|
|
6
|
-
rubocop-
|
|
7
|
-
rubocop-
|
|
4
|
+
Dutchie-Style (2.0.11)
|
|
5
|
+
rubocop (~> 1.72)
|
|
6
|
+
rubocop-capybara (~> 2.18)
|
|
7
|
+
rubocop-factory_bot (~> 2.24)
|
|
8
|
+
rubocop-rails (~> 2.21)
|
|
9
|
+
rubocop-rspec (~> 2.24)
|
|
10
|
+
rubocop-rspec_rails (~> 2.25)
|
|
8
11
|
|
|
9
12
|
GEM
|
|
10
13
|
remote: https://rubygems.org/
|
|
@@ -14,25 +17,25 @@ GEM
|
|
|
14
17
|
i18n (>= 1.6, < 2)
|
|
15
18
|
minitest (>= 5.1)
|
|
16
19
|
tzinfo (~> 2.0)
|
|
17
|
-
ast (2.4.
|
|
18
|
-
base64 (0.1.1)
|
|
20
|
+
ast (2.4.3)
|
|
19
21
|
concurrent-ruby (1.2.2)
|
|
20
22
|
diff-lcs (1.4.2)
|
|
21
23
|
i18n (1.14.1)
|
|
22
24
|
concurrent-ruby (~> 1.0)
|
|
23
|
-
json (2.
|
|
24
|
-
language_server-protocol (3.17.0.
|
|
25
|
+
json (2.13.2)
|
|
26
|
+
language_server-protocol (3.17.0.5)
|
|
27
|
+
lint_roller (1.1.0)
|
|
25
28
|
minitest (5.20.0)
|
|
26
|
-
parallel (1.
|
|
27
|
-
parser (3.
|
|
29
|
+
parallel (1.27.0)
|
|
30
|
+
parser (3.3.9.0)
|
|
28
31
|
ast (~> 2.4.1)
|
|
29
32
|
racc
|
|
30
|
-
|
|
33
|
+
prism (1.4.0)
|
|
34
|
+
racc (1.8.1)
|
|
31
35
|
rack (3.0.8)
|
|
32
36
|
rainbow (3.1.1)
|
|
33
37
|
rake (12.3.3)
|
|
34
|
-
regexp_parser (2.
|
|
35
|
-
rexml (3.2.6)
|
|
38
|
+
regexp_parser (2.10.0)
|
|
36
39
|
rspec (3.9.0)
|
|
37
40
|
rspec-core (~> 3.9.0)
|
|
38
41
|
rspec-expectations (~> 3.9.0)
|
|
@@ -46,36 +49,44 @@ GEM
|
|
|
46
49
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
47
50
|
rspec-support (~> 3.9.0)
|
|
48
51
|
rspec-support (3.9.3)
|
|
49
|
-
rubocop (1.
|
|
50
|
-
base64 (~> 0.1.1)
|
|
52
|
+
rubocop (1.79.0)
|
|
51
53
|
json (~> 2.3)
|
|
52
|
-
language_server-protocol (
|
|
54
|
+
language_server-protocol (~> 3.17.0.2)
|
|
55
|
+
lint_roller (~> 1.1.0)
|
|
53
56
|
parallel (~> 1.10)
|
|
54
|
-
parser (>= 3.
|
|
57
|
+
parser (>= 3.3.0.2)
|
|
55
58
|
rainbow (>= 2.2.2, < 4.0)
|
|
56
|
-
regexp_parser (>=
|
|
57
|
-
|
|
58
|
-
rubocop-ast (>= 1.28.1, < 2.0)
|
|
59
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
|
60
|
+
rubocop-ast (>= 1.46.0, < 2.0)
|
|
59
61
|
ruby-progressbar (~> 1.7)
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
tsort (>= 0.2.0)
|
|
63
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
|
64
|
+
rubocop-ast (1.46.0)
|
|
65
|
+
parser (>= 3.3.7.2)
|
|
66
|
+
prism (~> 1.4)
|
|
63
67
|
rubocop-capybara (2.18.0)
|
|
64
68
|
rubocop (~> 1.41)
|
|
65
|
-
rubocop-factory_bot (2.
|
|
66
|
-
|
|
67
|
-
|
|
69
|
+
rubocop-factory_bot (2.27.1)
|
|
70
|
+
lint_roller (~> 1.1)
|
|
71
|
+
rubocop (~> 1.72, >= 1.72.1)
|
|
72
|
+
rubocop-rails (2.22.1)
|
|
68
73
|
activesupport (>= 4.2.0)
|
|
69
74
|
rack (>= 1.1)
|
|
70
|
-
rubocop (>= 1.
|
|
71
|
-
rubocop-rspec (2.
|
|
72
|
-
rubocop (~> 1.
|
|
75
|
+
rubocop (>= 1.33.0, < 2.0)
|
|
76
|
+
rubocop-rspec (2.31.0)
|
|
77
|
+
rubocop (~> 1.40)
|
|
73
78
|
rubocop-capybara (~> 2.17)
|
|
74
79
|
rubocop-factory_bot (~> 2.22)
|
|
80
|
+
rubocop-rspec_rails (~> 2.28)
|
|
81
|
+
rubocop-rspec_rails (2.29.0)
|
|
82
|
+
rubocop (~> 1.40)
|
|
75
83
|
ruby-progressbar (1.13.0)
|
|
84
|
+
tsort (0.2.0)
|
|
76
85
|
tzinfo (2.0.6)
|
|
77
86
|
concurrent-ruby (~> 1.0)
|
|
78
|
-
unicode-display_width (
|
|
87
|
+
unicode-display_width (3.1.4)
|
|
88
|
+
unicode-emoji (~> 4.0, >= 4.0.4)
|
|
89
|
+
unicode-emoji (4.0.4)
|
|
79
90
|
|
|
80
91
|
PLATFORMS
|
|
81
92
|
ruby
|
|
@@ -84,7 +95,7 @@ DEPENDENCIES
|
|
|
84
95
|
Dutchie-Style!
|
|
85
96
|
rake (~> 12.0)
|
|
86
97
|
rspec (~> 3.0)
|
|
87
|
-
rubocop (~> 1.
|
|
98
|
+
rubocop (~> 1.72)
|
|
88
99
|
rubocop-rails (~> 2.14)
|
|
89
100
|
|
|
90
101
|
BUNDLED WITH
|
data/README.md
CHANGED
|
@@ -8,6 +8,8 @@ This repo contains all shared linter configs and style guides used by dutchie en
|
|
|
8
8
|
|
|
9
9
|
It is available as a rubygem as well as an NPM package.
|
|
10
10
|
|
|
11
|
+
To run rubocop on the project using the current style guide: `bundle exec rubocop -c config/default.yml`.
|
|
12
|
+
|
|
11
13
|
[Join Us! We're Hiring!](https://dutchie.com/careers)
|
|
12
14
|
|
|
13
15
|
Includes:
|
|
@@ -15,4 +17,4 @@ Includes:
|
|
|
15
17
|
* RuboCop Config
|
|
16
18
|
* RuboCop Rspec Config
|
|
17
19
|
* Eslint Config
|
|
18
|
-
* Prettier Config
|
|
20
|
+
* Prettier Config
|
data/config/default.yml
ADDED
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
require:
|
|
2
|
+
- rubocop-rspec
|
|
3
|
+
- rubocop-rspec_rails
|
|
4
|
+
- rubocop-rails
|
|
5
|
+
- rubocop-capybara
|
|
6
|
+
|
|
7
|
+
AllCops:
|
|
8
|
+
TargetRubyVersion: 3.1.4
|
|
9
|
+
EnabledByDefault: true
|
|
10
|
+
DisplayCopNames: true
|
|
11
|
+
Exclude:
|
|
12
|
+
- 'bin/**/*'
|
|
13
|
+
- 'db/**/*'
|
|
14
|
+
- 'vendor/**/*'
|
|
15
|
+
- 'config/**/*'
|
|
16
|
+
- 'docs/**/*'
|
|
17
|
+
- 'app/channels/**/*'
|
|
18
|
+
- 'script/**/*'
|
|
19
|
+
- 'lib/assets/**/*'
|
|
20
|
+
- 'Rakefile'
|
|
21
|
+
- 'Gemfile'
|
|
22
|
+
- 'Guardfile'
|
|
23
|
+
- '*.yml'
|
|
24
|
+
- '.pryrc'
|
|
25
|
+
|
|
26
|
+
# Capybara/RSpec cops
|
|
27
|
+
|
|
28
|
+
# Allows us to use scenario/feature instead of it/describes
|
|
29
|
+
RSpec/Dialect:
|
|
30
|
+
Enabled: true
|
|
31
|
+
PreferredMethods: ['feature', 'scenario']
|
|
32
|
+
|
|
33
|
+
# https://docs.rubocop.org/rubocop/1.10/cops_layout.html#layoutclassstructure
|
|
34
|
+
Layout/ClassStructure:
|
|
35
|
+
Enabled: true
|
|
36
|
+
|
|
37
|
+
# Commonly used screens these days easily fit more than 80 characters.
|
|
38
|
+
# Ignores long lines with Heredocs or URIs in them
|
|
39
|
+
Layout/LineLength:
|
|
40
|
+
Max: 120
|
|
41
|
+
AllowHeredoc: true
|
|
42
|
+
# - There's a bug which considers commas after a URI too long so we can't use built-in AllowURI setting.
|
|
43
|
+
# Pattern matches valid URI encapsulated within a string literal.
|
|
44
|
+
# - Ignore top level comments (sometimes autogenerated, e.g. annotate_models)
|
|
45
|
+
AllowedPatterns: ['["\u0027].*https?[\w\:\/\$\–\-\#\.\+\!\*\‘\(\)\,]*.*["\u0027]', '\A#']
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
# No space makes the method definition shorter and differentiates
|
|
49
|
+
# from a regular assignment.
|
|
50
|
+
Layout/SpaceAroundEqualsInParameterDefault:
|
|
51
|
+
EnforcedStyle: no_space
|
|
52
|
+
|
|
53
|
+
# Most readable form.
|
|
54
|
+
Layout/HashAlignment:
|
|
55
|
+
EnforcedHashRocketStyle: table
|
|
56
|
+
EnforcedColonStyle: table
|
|
57
|
+
|
|
58
|
+
# Indenting the chained dots beneath each other is not supported by this cop,
|
|
59
|
+
# see https://github.com/bbatsov/rubocop/issues/1633
|
|
60
|
+
Layout/MultilineOperationIndentation:
|
|
61
|
+
Enabled: false
|
|
62
|
+
|
|
63
|
+
# Suppressing exceptions can be perfectly fine, and be it to avoid to
|
|
64
|
+
# explicitly type nil into the rescue since that's what you want to return,
|
|
65
|
+
# or suppressing LoadError for optional dependencies
|
|
66
|
+
Lint/SuppressedException:
|
|
67
|
+
Enabled: false
|
|
68
|
+
|
|
69
|
+
Layout/SpaceInsideBlockBraces:
|
|
70
|
+
# The space here provides no real gain in readability while consuming
|
|
71
|
+
# horizontal space that could be used for a better parameter name.
|
|
72
|
+
# Also {| differentiates better from a hash than { | does.
|
|
73
|
+
SpaceBeforeBlockParameters: false
|
|
74
|
+
|
|
75
|
+
# No trailing space differentiates better from the block:
|
|
76
|
+
# foo} means hash, foo } means block.
|
|
77
|
+
Layout/SpaceInsideHashLiteralBraces:
|
|
78
|
+
EnforcedStyle: no_space
|
|
79
|
+
|
|
80
|
+
# Exclude RSpec
|
|
81
|
+
Metrics/BlockLength:
|
|
82
|
+
Exclude:
|
|
83
|
+
- "spec/factories/**/*.rb"
|
|
84
|
+
AllowedMethods: ['describe', 'context']
|
|
85
|
+
|
|
86
|
+
# Too short methods lead to extraction of single-use methods, which can make
|
|
87
|
+
# the code easier to read (by naming things), but can also clutter the class
|
|
88
|
+
Metrics/MethodLength:
|
|
89
|
+
Max: 20
|
|
90
|
+
|
|
91
|
+
# The guiding principle of classes is SRP, SRP can't be accurately measured by LoC
|
|
92
|
+
Metrics/ClassLength:
|
|
93
|
+
Max: 1500
|
|
94
|
+
|
|
95
|
+
# Check with yard instead.
|
|
96
|
+
Style/DocumentationMethod:
|
|
97
|
+
Enabled: false
|
|
98
|
+
|
|
99
|
+
Style/Copyright:
|
|
100
|
+
Enabled: false
|
|
101
|
+
|
|
102
|
+
Style/Documentation:
|
|
103
|
+
Enabled: false
|
|
104
|
+
|
|
105
|
+
# We are using DateTime extensively.
|
|
106
|
+
Style/DateTime:
|
|
107
|
+
Enabled: false
|
|
108
|
+
|
|
109
|
+
# We do not need to support Ruby 1.9, so this is good to use.
|
|
110
|
+
Style/SymbolArray:
|
|
111
|
+
Enabled: true
|
|
112
|
+
|
|
113
|
+
# https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/MissingElse
|
|
114
|
+
Style/MissingElse:
|
|
115
|
+
Enabled: false
|
|
116
|
+
|
|
117
|
+
# https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/StringHashKeys
|
|
118
|
+
Style/StringHashKeys:
|
|
119
|
+
Enabled: false
|
|
120
|
+
|
|
121
|
+
# Single quotes being faster is hardly measurable and only affects parse time.
|
|
122
|
+
# Enforcing double quotes reduces the times where you need to change them
|
|
123
|
+
# when introducing an interpolation. Use single quotes only if their semantics
|
|
124
|
+
# are needed.
|
|
125
|
+
Style/StringLiterals:
|
|
126
|
+
EnforcedStyle: double_quotes
|
|
127
|
+
|
|
128
|
+
Style/HashSyntax:
|
|
129
|
+
EnforcedStyle: ruby19_no_mixed_keys
|
|
130
|
+
EnforcedShorthandSyntax: either
|
|
131
|
+
|
|
132
|
+
# https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/HashEachMethods
|
|
133
|
+
Style/HashEachMethods:
|
|
134
|
+
Enabled: true
|
|
135
|
+
|
|
136
|
+
# https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/HashTransformKeys
|
|
137
|
+
Style/HashTransformKeys:
|
|
138
|
+
Enabled: false
|
|
139
|
+
|
|
140
|
+
# https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/HashTransformValues
|
|
141
|
+
Style/HashTransformValues:
|
|
142
|
+
Enabled: false
|
|
143
|
+
|
|
144
|
+
# has_key? and has_value? are far more readable than key? and value?
|
|
145
|
+
Style/PreferredHashMethods:
|
|
146
|
+
Enabled: false
|
|
147
|
+
|
|
148
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styledisablecopswithinsourcecodedirective
|
|
149
|
+
Style/DisableCopsWithinSourceCodeDirective:
|
|
150
|
+
Enabled: false
|
|
151
|
+
|
|
152
|
+
# String#% is by far the least verbose and only object oriented variant.
|
|
153
|
+
Style/FormatString:
|
|
154
|
+
EnforcedStyle: percent
|
|
155
|
+
|
|
156
|
+
Style/CollectionMethods:
|
|
157
|
+
Enabled: true
|
|
158
|
+
PreferredMethods:
|
|
159
|
+
# find is not equivalent on mongoid embeds or collections
|
|
160
|
+
find: "detect"
|
|
161
|
+
# inject seems more common in the community.
|
|
162
|
+
reduce: "inject"
|
|
163
|
+
|
|
164
|
+
# Either allow this style or don't. Marking it as safe with parenthesis
|
|
165
|
+
# is silly. Let's try to live without them for now.
|
|
166
|
+
Style/ParenthesesAroundCondition:
|
|
167
|
+
AllowSafeAssignment: false
|
|
168
|
+
|
|
169
|
+
# https://github.com/rubocop-hq/rubocop/blob/master/config/default.yml#L3095
|
|
170
|
+
# https://getdutchie.slack.com/archives/CJQCWSWQ4/p1592860363429600
|
|
171
|
+
# Optional inline and required multi
|
|
172
|
+
Style/MethodCallWithArgsParentheses:
|
|
173
|
+
Description: 'Use parentheses for method calls with arguments.'
|
|
174
|
+
StyleGuide: '#method-invocation-parens'
|
|
175
|
+
Enabled: false
|
|
176
|
+
VersionAdded: '0.47'
|
|
177
|
+
VersionChanged: '0.61'
|
|
178
|
+
IgnoreMacros: true
|
|
179
|
+
AllowedMethods: []
|
|
180
|
+
AllowedPatterns: []
|
|
181
|
+
IncludedMacros: []
|
|
182
|
+
AllowParenthesesInMultilineCall: false
|
|
183
|
+
AllowParenthesesInChaining: false
|
|
184
|
+
AllowParenthesesInCamelCaseMethod: false
|
|
185
|
+
EnforcedStyle: require_parentheses
|
|
186
|
+
SupportedStyles:
|
|
187
|
+
- require_parentheses
|
|
188
|
+
- omit_parentheses
|
|
189
|
+
|
|
190
|
+
Style/MethodCallWithoutArgsParentheses:
|
|
191
|
+
Description: 'Do not use parentheses for method calls with no arguments.'
|
|
192
|
+
StyleGuide: '#method-invocation-parens'
|
|
193
|
+
Enabled: true
|
|
194
|
+
AllowedMethods: []
|
|
195
|
+
VersionAdded: '0.47'
|
|
196
|
+
VersionChanged: '0.55'
|
|
197
|
+
|
|
198
|
+
# A specialized exception class will take one or more arguments and construct the message from it.
|
|
199
|
+
# So both variants make sense.
|
|
200
|
+
Style/RaiseArgs:
|
|
201
|
+
Enabled: false
|
|
202
|
+
|
|
203
|
+
# Fail is an alias of raise. Avoid aliases, it's more cognitive load for no gain.
|
|
204
|
+
# The argument that fail should be used to abort the program is wrong too,
|
|
205
|
+
# there's Kernel#abort for that.
|
|
206
|
+
Style/SignalException:
|
|
207
|
+
EnforcedStyle: only_raise
|
|
208
|
+
|
|
209
|
+
# do / end blocks should be used for side effects,
|
|
210
|
+
# methods that run a block for side effects and have
|
|
211
|
+
# a useful return value are rare, assign the return
|
|
212
|
+
# value to a local variable for those cases.
|
|
213
|
+
Style/MethodCalledOnDoEndBlock:
|
|
214
|
+
Enabled: true
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
# OpenStruct shouldn't be used anymore due to performance
|
|
218
|
+
# degradation on ruby 3.2+
|
|
219
|
+
Style/OpenStructUse:
|
|
220
|
+
Enabled: true
|
|
221
|
+
|
|
222
|
+
# Enforcing the names of variables? To single letter ones? Just no.
|
|
223
|
+
Style/SingleLineBlockParams:
|
|
224
|
+
Enabled: false
|
|
225
|
+
|
|
226
|
+
# Style preference
|
|
227
|
+
Style/MethodDefParentheses:
|
|
228
|
+
Enabled: false
|
|
229
|
+
|
|
230
|
+
# Ignores requirement to add underscore to separate every 3 digits in a number
|
|
231
|
+
Style/NumericLiterals:
|
|
232
|
+
Enabled: false
|
|
233
|
+
|
|
234
|
+
# Shadowing outer local variables with block parameters is often useful
|
|
235
|
+
# to not reinvent a new name for the same thing, it highlights the relation
|
|
236
|
+
# between the outer variable and the parameter. The cases where it's actually
|
|
237
|
+
# confusing are rare, and usually bad for other reasons already, for example
|
|
238
|
+
# because the method is too long.
|
|
239
|
+
Lint/ShadowingOuterLocalVariable:
|
|
240
|
+
Enabled: false
|
|
241
|
+
|
|
242
|
+
# https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Lint/Debugger
|
|
243
|
+
# Show linting errors on debugger/binding.pry even in development
|
|
244
|
+
Lint/Debugger:
|
|
245
|
+
Enabled: true
|
|
246
|
+
|
|
247
|
+
Lint/AssignmentInCondition:
|
|
248
|
+
AllowSafeAssignment: false
|
|
249
|
+
|
|
250
|
+
# https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Lint/NumberConversion
|
|
251
|
+
Lint/NumberConversion:
|
|
252
|
+
Enabled: false
|
|
253
|
+
|
|
254
|
+
Naming/BinaryOperatorParameterName:
|
|
255
|
+
Enabled: false
|
|
256
|
+
|
|
257
|
+
Lint/ConstantResolution:
|
|
258
|
+
Enabled: false
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
# Rails
|
|
262
|
+
Rails/SaveBang:
|
|
263
|
+
Enabled: false
|
|
264
|
+
|
|
265
|
+
# Temporarily removing until Mongoid is no more...
|
|
266
|
+
# Mongoid #find_by raises an exception if it can't be found, unlike AR #find_by, so .where().first is preferred
|
|
267
|
+
# Rubocop can't tell the difference between the two
|
|
268
|
+
Rails/FindBy:
|
|
269
|
+
Enabled: false
|
|
270
|
+
Include:
|
|
271
|
+
- app/**/*.rb
|
|
272
|
+
|
|
273
|
+
# not a method in mongoid
|
|
274
|
+
Rails/FindEach:
|
|
275
|
+
Enabled: false
|
|
276
|
+
|
|
277
|
+
Rails/PluckId:
|
|
278
|
+
Enabled: false
|
|
279
|
+
|
|
280
|
+
Rails/PluckInWhere:
|
|
281
|
+
Enabled: false
|
|
282
|
+
|
|
283
|
+
# RSpec
|
|
284
|
+
|
|
285
|
+
# Start context description without 'when', 'with', or 'without'.
|
|
286
|
+
RSpec/ContextWording:
|
|
287
|
+
Enabled: false
|
|
288
|
+
|
|
289
|
+
RSpec/AlignLeftLetBrace:
|
|
290
|
+
Enabled: true
|
|
291
|
+
|
|
292
|
+
RSpec/AlignRightLetBrace:
|
|
293
|
+
Enabled: false
|
|
294
|
+
|
|
295
|
+
RSpec/MultipleMemoizedHelpers:
|
|
296
|
+
Enabled: false
|
|
297
|
+
|
|
298
|
+
RSpec/NestedGroups:
|
|
299
|
+
Max: 5
|
|
300
|
+
|
|
301
|
+
# Allows us to mark specs as "skip"
|
|
302
|
+
RSpec/Pending:
|
|
303
|
+
Enabled: false
|
data/lib/Dutchie/Style.rb
CHANGED
|
@@ -1,8 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require "Dutchie/Style/version"
|
|
2
4
|
|
|
3
5
|
module Dutchie
|
|
4
6
|
module Style
|
|
5
7
|
class Error < StandardError; end
|
|
6
|
-
|
|
8
|
+
|
|
9
|
+
# Returns the absolute path to the default configuration file
|
|
10
|
+
def self.config_path
|
|
11
|
+
File.expand_path("../../config/default.yml", __dir__)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Returns the gem's root directory
|
|
15
|
+
def self.root
|
|
16
|
+
File.expand_path("../..", __dir__)
|
|
17
|
+
end
|
|
7
18
|
end
|
|
8
19
|
end
|
|
@@ -3,7 +3,7 @@ require:
|
|
|
3
3
|
- rubocop-rails
|
|
4
4
|
|
|
5
5
|
AllCops:
|
|
6
|
-
TargetRubyVersion: 2.
|
|
6
|
+
TargetRubyVersion: 2.7.4
|
|
7
7
|
EnabledByDefault: true
|
|
8
8
|
DisplayCopNames: true
|
|
9
9
|
Exclude:
|
|
@@ -21,7 +21,6 @@ AllCops:
|
|
|
21
21
|
- '*.yml'
|
|
22
22
|
- '.pryrc'
|
|
23
23
|
|
|
24
|
-
|
|
25
24
|
# Capybara cops
|
|
26
25
|
|
|
27
26
|
# Allows us to use scenario/feature instead of it/describes
|
|
@@ -80,7 +79,7 @@ Layout/SpaceInsideHashLiteralBraces:
|
|
|
80
79
|
Metrics/BlockLength:
|
|
81
80
|
Exclude:
|
|
82
81
|
- "spec/factories/**/*.rb"
|
|
83
|
-
|
|
82
|
+
AllowedMethods: ['describe', 'context']
|
|
84
83
|
|
|
85
84
|
# Too short methods lead to extraction of single-use methods, which can make
|
|
86
85
|
# the code easier to read (by naming things), but can also clutter the class
|
|
@@ -175,7 +174,7 @@ Style/MethodCallWithArgsParentheses:
|
|
|
175
174
|
VersionAdded: '0.47'
|
|
176
175
|
VersionChanged: '0.61'
|
|
177
176
|
IgnoreMacros: true
|
|
178
|
-
|
|
177
|
+
AllowedMethods: []
|
|
179
178
|
AllowedPatterns: []
|
|
180
179
|
IncludedMacros: []
|
|
181
180
|
AllowParenthesesInMultilineCall: false
|
|
@@ -190,7 +189,7 @@ Style/MethodCallWithoutArgsParentheses:
|
|
|
190
189
|
Description: 'Do not use parentheses for method calls with no arguments.'
|
|
191
190
|
StyleGuide: '#method-invocation-parens'
|
|
192
191
|
Enabled: true
|
|
193
|
-
|
|
192
|
+
AllowedMethods: []
|
|
194
193
|
VersionAdded: '0.47'
|
|
195
194
|
VersionChanged: '0.55'
|
|
196
195
|
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: Dutchie-Style
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.11
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Christopher Ostrowski
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 2025-11-07 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: rubocop
|
|
@@ -16,42 +15,84 @@ dependencies:
|
|
|
16
15
|
requirements:
|
|
17
16
|
- - "~>"
|
|
18
17
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '1.
|
|
18
|
+
version: '1.72'
|
|
20
19
|
type: :runtime
|
|
21
20
|
prerelease: false
|
|
22
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
22
|
requirements:
|
|
24
23
|
- - "~>"
|
|
25
24
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '1.
|
|
25
|
+
version: '1.72'
|
|
27
26
|
- !ruby/object:Gem::Dependency
|
|
28
|
-
name: rubocop-
|
|
27
|
+
name: rubocop-capybara
|
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - "~>"
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '2.18'
|
|
33
|
+
type: :runtime
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - "~>"
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '2.18'
|
|
40
|
+
- !ruby/object:Gem::Dependency
|
|
41
|
+
name: rubocop-factory_bot
|
|
29
42
|
requirement: !ruby/object:Gem::Requirement
|
|
30
43
|
requirements:
|
|
31
|
-
- - "
|
|
44
|
+
- - "~>"
|
|
32
45
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '
|
|
46
|
+
version: '2.24'
|
|
34
47
|
type: :runtime
|
|
35
48
|
prerelease: false
|
|
36
49
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
50
|
requirements:
|
|
38
|
-
- - "
|
|
51
|
+
- - "~>"
|
|
39
52
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: '
|
|
53
|
+
version: '2.24'
|
|
41
54
|
- !ruby/object:Gem::Dependency
|
|
42
55
|
name: rubocop-rails
|
|
43
56
|
requirement: !ruby/object:Gem::Requirement
|
|
44
57
|
requirements:
|
|
45
|
-
- - "
|
|
58
|
+
- - "~>"
|
|
46
59
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: '
|
|
60
|
+
version: '2.21'
|
|
48
61
|
type: :runtime
|
|
49
62
|
prerelease: false
|
|
50
63
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
64
|
requirements:
|
|
52
|
-
- - "
|
|
65
|
+
- - "~>"
|
|
66
|
+
- !ruby/object:Gem::Version
|
|
67
|
+
version: '2.21'
|
|
68
|
+
- !ruby/object:Gem::Dependency
|
|
69
|
+
name: rubocop-rspec
|
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
|
71
|
+
requirements:
|
|
72
|
+
- - "~>"
|
|
73
|
+
- !ruby/object:Gem::Version
|
|
74
|
+
version: '2.24'
|
|
75
|
+
type: :runtime
|
|
76
|
+
prerelease: false
|
|
77
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
78
|
+
requirements:
|
|
79
|
+
- - "~>"
|
|
80
|
+
- !ruby/object:Gem::Version
|
|
81
|
+
version: '2.24'
|
|
82
|
+
- !ruby/object:Gem::Dependency
|
|
83
|
+
name: rubocop-rspec_rails
|
|
84
|
+
requirement: !ruby/object:Gem::Requirement
|
|
85
|
+
requirements:
|
|
86
|
+
- - "~>"
|
|
87
|
+
- !ruby/object:Gem::Version
|
|
88
|
+
version: '2.25'
|
|
89
|
+
type: :runtime
|
|
90
|
+
prerelease: false
|
|
91
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
92
|
+
requirements:
|
|
93
|
+
- - "~>"
|
|
53
94
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: '
|
|
95
|
+
version: '2.25'
|
|
55
96
|
description: Rubocop Settings for all dutchie Ruby Apps
|
|
56
97
|
email:
|
|
57
98
|
- chris@dutchie.com
|
|
@@ -65,9 +106,11 @@ files:
|
|
|
65
106
|
- Gemfile
|
|
66
107
|
- Gemfile.lock
|
|
67
108
|
- README.md
|
|
68
|
-
- default.yml
|
|
109
|
+
- config/default.yml
|
|
69
110
|
- lib/Dutchie/Style.rb
|
|
70
111
|
- lib/Dutchie/Style/version.rb
|
|
112
|
+
- lib/dutchie-style.rb
|
|
113
|
+
- old-default.yml
|
|
71
114
|
homepage: https://github.com/GetDutchie/Dutchie-Style
|
|
72
115
|
licenses:
|
|
73
116
|
- MIT
|
|
@@ -75,7 +118,7 @@ metadata:
|
|
|
75
118
|
homepage_uri: https://github.com/GetDutchie/Dutchie-Style
|
|
76
119
|
source_code_uri: https://github.com/GetDutchie/Dutchie-Style
|
|
77
120
|
changelog_uri: https://github.com/GetDutchie/Dutchie-Style/releases
|
|
78
|
-
|
|
121
|
+
rubygems_mfa_required: 'true'
|
|
79
122
|
rdoc_options: []
|
|
80
123
|
require_paths:
|
|
81
124
|
- lib
|
|
@@ -83,15 +126,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
83
126
|
requirements:
|
|
84
127
|
- - ">="
|
|
85
128
|
- !ruby/object:Gem::Version
|
|
86
|
-
version:
|
|
129
|
+
version: 3.1.4
|
|
87
130
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
88
131
|
requirements:
|
|
89
132
|
- - ">="
|
|
90
133
|
- !ruby/object:Gem::Version
|
|
91
134
|
version: '0'
|
|
92
135
|
requirements: []
|
|
93
|
-
rubygems_version: 3.
|
|
94
|
-
signing_key:
|
|
136
|
+
rubygems_version: 3.6.2
|
|
95
137
|
specification_version: 4
|
|
96
138
|
summary: Rubocop Settings for all dutchie Ruby Apps
|
|
97
139
|
test_files: []
|