Dutchie-Style 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.editorconfig +12 -0
- data/.gitignore +32 -0
- data/Dutchie-Style.gemspec +28 -0
- data/Gemfile +8 -0
- data/README.md +17 -0
- data/default.yml +217 -0
- data/lib/Dutchie/Style.rb +8 -0
- data/lib/Dutchie/Style/version.rb +5 -0
- metadata +67 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d6b2a358d911c4029b29bca907108565f063310fdbafb8943d2e26280ae6f244
|
4
|
+
data.tar.gz: 4b4773a79dc3816ec0b91ea449843ac8318718e727aabcff1d6c4727e9bc40c0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 1af2412d988306af579894d663732726d86e5569702e06321266fbea13b59bf1c3970d6700e7c82c44e564f01800ac251ee18db45c4514cef6bfc1e3d4ce1194
|
7
|
+
data.tar.gz: da5b2893cfb5b3b555313606eedabb48f932b861435d8425f778355e121fe0540616bc57a90db7ec843a9073c07b4cafc13eb17e93e66761d30f5529afe91c9c
|
data/.editorconfig
ADDED
data/.gitignore
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
|
2
|
+
#
|
3
|
+
# If you find yourself ignoring temporary files generated by your text editor
|
4
|
+
# or operating system, you probably want to add a global ignore instead:
|
5
|
+
# git config --global core.excludesfile '~/.gitignore_global'
|
6
|
+
|
7
|
+
# Package Managers
|
8
|
+
/.bundle
|
9
|
+
node_modules/
|
10
|
+
yarn-error.log
|
11
|
+
|
12
|
+
# Ignore all logfiles and tempfiles.
|
13
|
+
/log/*
|
14
|
+
/tmp/*
|
15
|
+
!/log/.keep
|
16
|
+
!/tmp/.keep
|
17
|
+
|
18
|
+
.byebug_history
|
19
|
+
|
20
|
+
# Ignore master key for decrypting credentials and more.
|
21
|
+
/config/master.key
|
22
|
+
|
23
|
+
.env
|
24
|
+
|
25
|
+
# Emacs droppings
|
26
|
+
*~
|
27
|
+
|
28
|
+
# Mac OS noise
|
29
|
+
.DS_Store
|
30
|
+
|
31
|
+
# SimpleCov output dir
|
32
|
+
coverage
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require_relative 'lib/Dutchie/Style/version'
|
2
|
+
|
3
|
+
Gem::Specification.new do |spec|
|
4
|
+
spec.name = "Dutchie-Style"
|
5
|
+
spec.version = Dutchie::Style::VERSION
|
6
|
+
spec.authors = ["Christopher Ostrowski"]
|
7
|
+
spec.email = ["chris@dutchie.com"]
|
8
|
+
|
9
|
+
spec.summary = %q{Rubocop Settings for all dutchie Ruby Apps}
|
10
|
+
spec.description = %q{Rubocop Settings for all dutchie Ruby Apps}
|
11
|
+
spec.homepage = "https://github.com/GetDutchie/Dutchie-Style"
|
12
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
13
|
+
|
14
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
15
|
+
spec.metadata["source_code_uri"] = "https://github.com/GetDutchie/Dutchie-Style"
|
16
|
+
spec.metadata["changelog_uri"] = "https://github.com/GetDutchie/Dutchie-Style/releases"
|
17
|
+
|
18
|
+
# Specify which files should be added to the gem when it is released.
|
19
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
20
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
21
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
22
|
+
end
|
23
|
+
spec.bindir = "exe"
|
24
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
25
|
+
spec.require_paths = ["lib"]
|
26
|
+
|
27
|
+
spec.add_dependency "rubocop", "~> 0.80.0"
|
28
|
+
end
|
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
![Dutchie](https://cl.ly/360R2A3q1D31/icon.png)
|
2
|
+
|
3
|
+
# Dutchie-Style
|
4
|
+
|
5
|
+
## About This Repo
|
6
|
+
|
7
|
+
This repo contains all shared linter configs and style guides used by dutchie engineering.
|
8
|
+
|
9
|
+
It is available as a rubygem as well as an NPM package.
|
10
|
+
|
11
|
+
[Join Us! We're Hiring!](https://dutchie.com/careers)
|
12
|
+
|
13
|
+
Includes:
|
14
|
+
|
15
|
+
* RuboCop Config
|
16
|
+
* Eslint Config
|
17
|
+
* Prettier Config
|
data/default.yml
ADDED
@@ -0,0 +1,217 @@
|
|
1
|
+
AllCops:
|
2
|
+
TargetRubyVersion: 2.6
|
3
|
+
EnabledByDefault: true
|
4
|
+
DisplayCopNames: true
|
5
|
+
Exclude:
|
6
|
+
- 'bin/**/*'
|
7
|
+
- 'db/**/*'
|
8
|
+
- 'vendor/**/*'
|
9
|
+
- 'config/**/*'
|
10
|
+
- 'docs/**/*'
|
11
|
+
- 'spec/**/*'
|
12
|
+
- 'app/channels/**/*'
|
13
|
+
- 'script/**/*'
|
14
|
+
- 'lib/assets/**/*'
|
15
|
+
- 'Rakefile'
|
16
|
+
- 'Gemfile'
|
17
|
+
- 'Guardfile'
|
18
|
+
- '*.yml'
|
19
|
+
- '.pryrc'
|
20
|
+
|
21
|
+
# Commonly used screens these days easily fit more than 80 characters.
|
22
|
+
Layout/LineLength:
|
23
|
+
Max: 120
|
24
|
+
|
25
|
+
# No space makes the method definition shorter and differentiates
|
26
|
+
# from a regular assignment.
|
27
|
+
Layout/SpaceAroundEqualsInParameterDefault:
|
28
|
+
EnforcedStyle: no_space
|
29
|
+
|
30
|
+
# Most readable form.
|
31
|
+
Layout/HashAlignment:
|
32
|
+
EnforcedHashRocketStyle: table
|
33
|
+
EnforcedColonStyle: table
|
34
|
+
|
35
|
+
# Indenting the chained dots beneath each other is not supported by this cop,
|
36
|
+
# see https://github.com/bbatsov/rubocop/issues/1633
|
37
|
+
Layout/MultilineOperationIndentation:
|
38
|
+
Enabled: false
|
39
|
+
|
40
|
+
# Suppressing exceptions can be perfectly fine, and be it to avoid to
|
41
|
+
# explicitly type nil into the rescue since that's what you want to return,
|
42
|
+
# or suppressing LoadError for optional dependencies
|
43
|
+
Lint/SuppressedException:
|
44
|
+
Enabled: false
|
45
|
+
|
46
|
+
Layout/SpaceInsideBlockBraces:
|
47
|
+
# The space here provides no real gain in readability while consuming
|
48
|
+
# horizontal space that could be used for a better parameter name.
|
49
|
+
# Also {| differentiates better from a hash than { | does.
|
50
|
+
SpaceBeforeBlockParameters: false
|
51
|
+
|
52
|
+
# No trailing space differentiates better from the block:
|
53
|
+
# foo} means hash, foo } means block.
|
54
|
+
Layout/SpaceInsideHashLiteralBraces:
|
55
|
+
EnforcedStyle: no_space
|
56
|
+
|
57
|
+
# Too short methods lead to extraction of single-use methods, which can make
|
58
|
+
# the code easier to read (by naming things), but can also clutter the class
|
59
|
+
Metrics/MethodLength:
|
60
|
+
Max: 20
|
61
|
+
|
62
|
+
# The guiding principle of classes is SRP, SRP can't be accurately measured by LoC
|
63
|
+
Metrics/ClassLength:
|
64
|
+
Max: 1500
|
65
|
+
|
66
|
+
# Check with yard instead.
|
67
|
+
Style/DocumentationMethod:
|
68
|
+
Enabled: false
|
69
|
+
|
70
|
+
Style/Copyright:
|
71
|
+
Enabled: false
|
72
|
+
|
73
|
+
Style/Documentation:
|
74
|
+
Enabled: false
|
75
|
+
|
76
|
+
# We are using DateTime extensively.
|
77
|
+
Style/DateTime:
|
78
|
+
Enabled: false
|
79
|
+
|
80
|
+
# We do not need to support Ruby 1.9, so this is good to use.
|
81
|
+
Style/SymbolArray:
|
82
|
+
Enabled: true
|
83
|
+
|
84
|
+
# https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/MissingElse
|
85
|
+
Style/MissingElse:
|
86
|
+
Enabled: false
|
87
|
+
|
88
|
+
# https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/StringHashKeys
|
89
|
+
Style/StringHashKeys:
|
90
|
+
Enabled: false
|
91
|
+
|
92
|
+
# Single quotes being faster is hardly measurable and only affects parse time.
|
93
|
+
# Enforcing double quotes reduces the times where you need to change them
|
94
|
+
# when introducing an interpolation. Use single quotes only if their semantics
|
95
|
+
# are needed.
|
96
|
+
Style/StringLiterals:
|
97
|
+
EnforcedStyle: double_quotes
|
98
|
+
|
99
|
+
# Mixing the styles looks just silly.
|
100
|
+
Style/HashSyntax:
|
101
|
+
EnforcedStyle: ruby19_no_mixed_keys
|
102
|
+
|
103
|
+
Style/HashEachMethods:
|
104
|
+
Enabled: false
|
105
|
+
|
106
|
+
Style/HashTransformKeys:
|
107
|
+
Enabled: false
|
108
|
+
|
109
|
+
Style/HashTransformValues:
|
110
|
+
Enabled: false
|
111
|
+
|
112
|
+
# has_key? and has_value? are far more readable than key? and value?
|
113
|
+
Style/PreferredHashMethods:
|
114
|
+
Enabled: false
|
115
|
+
|
116
|
+
# https://docs.rubocop.org/rubocop/cops_style.html#styledisablecopswithinsourcecodedirective
|
117
|
+
Style/DisableCopsWithinSourceCodeDirective:
|
118
|
+
Enabled: false
|
119
|
+
|
120
|
+
# String#% is by far the least verbose and only object oriented variant.
|
121
|
+
Style/FormatString:
|
122
|
+
EnforcedStyle: percent
|
123
|
+
|
124
|
+
Style/CollectionMethods:
|
125
|
+
Enabled: true
|
126
|
+
PreferredMethods:
|
127
|
+
# inject seems more common in the community.
|
128
|
+
reduce: "inject"
|
129
|
+
|
130
|
+
# Either allow this style or don't. Marking it as safe with parenthesis
|
131
|
+
# is silly. Let's try to live without them for now.
|
132
|
+
Style/ParenthesesAroundCondition:
|
133
|
+
AllowSafeAssignment: false
|
134
|
+
|
135
|
+
# https://github.com/rubocop-hq/rubocop/blob/master/config/default.yml#L3095
|
136
|
+
# https://getdutchie.slack.com/archives/CJQCWSWQ4/p1592860363429600
|
137
|
+
# Optional inline and required multi
|
138
|
+
Style/MethodCallWithArgsParentheses:
|
139
|
+
Description: 'Use parentheses for method calls with arguments.'
|
140
|
+
StyleGuide: '#method-invocation-parens'
|
141
|
+
Enabled: false
|
142
|
+
VersionAdded: '0.47'
|
143
|
+
VersionChanged: '0.61'
|
144
|
+
IgnoreMacros: true
|
145
|
+
IgnoredMethods: []
|
146
|
+
IgnoredPatterns: []
|
147
|
+
IncludedMacros: []
|
148
|
+
AllowParenthesesInMultilineCall: false
|
149
|
+
AllowParenthesesInChaining: false
|
150
|
+
AllowParenthesesInCamelCaseMethod: false
|
151
|
+
EnforcedStyle: require_parentheses
|
152
|
+
SupportedStyles:
|
153
|
+
- require_parentheses
|
154
|
+
- omit_parentheses
|
155
|
+
|
156
|
+
Style/MethodCallWithoutArgsParentheses:
|
157
|
+
Description: 'Do not use parentheses for method calls with no arguments.'
|
158
|
+
StyleGuide: '#method-invocation-parens'
|
159
|
+
Enabled: true
|
160
|
+
IgnoredMethods: []
|
161
|
+
VersionAdded: '0.47'
|
162
|
+
VersionChanged: '0.55'
|
163
|
+
|
164
|
+
# A specialized exception class will take one or more arguments and construct the message from it.
|
165
|
+
# So both variants make sense.
|
166
|
+
Style/RaiseArgs:
|
167
|
+
Enabled: false
|
168
|
+
|
169
|
+
# Fail is an alias of raise. Avoid aliases, it's more cognitive load for no gain.
|
170
|
+
# The argument that fail should be used to abort the program is wrong too,
|
171
|
+
# there's Kernel#abort for that.
|
172
|
+
Style/SignalException:
|
173
|
+
EnforcedStyle: only_raise
|
174
|
+
|
175
|
+
# { ... } for multi-line blocks is okay, follow Weirichs rule instead:
|
176
|
+
# https://web.archive.org/web/20140221124509/http://onestepback.org/index.cgi/Tech/Ruby/BraceVsDoEnd.rdoc
|
177
|
+
Style/BlockDelimiters:
|
178
|
+
Enabled: false
|
179
|
+
|
180
|
+
# do / end blocks should be used for side effects,
|
181
|
+
# methods that run a block for side effects and have
|
182
|
+
# a useful return value are rare, assign the return
|
183
|
+
# value to a local variable for those cases.
|
184
|
+
Style/MethodCalledOnDoEndBlock:
|
185
|
+
Enabled: true
|
186
|
+
|
187
|
+
# Enforcing the names of variables? To single letter ones? Just no.
|
188
|
+
Style/SingleLineBlockParams:
|
189
|
+
Enabled: false
|
190
|
+
|
191
|
+
# Style preference
|
192
|
+
Style/MethodDefParentheses:
|
193
|
+
Enabled: false
|
194
|
+
|
195
|
+
# Shadowing outer local variables with block parameters is often useful
|
196
|
+
# to not reinvent a new name for the same thing, it highlights the relation
|
197
|
+
# between the outer variable and the parameter. The cases where it's actually
|
198
|
+
# confusing are rare, and usually bad for other reasons already, for example
|
199
|
+
# because the method is too long.
|
200
|
+
Lint/ShadowingOuterLocalVariable:
|
201
|
+
Enabled: false
|
202
|
+
|
203
|
+
# There are valid cases, for example debugging Cucumber steps,
|
204
|
+
# also they'll fail CI anyway
|
205
|
+
Lint/Debugger:
|
206
|
+
Enabled: false
|
207
|
+
|
208
|
+
Lint/AssignmentInCondition:
|
209
|
+
AllowSafeAssignment: false
|
210
|
+
|
211
|
+
# https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Lint/NumberConversion
|
212
|
+
Lint/NumberConversion:
|
213
|
+
Enabled: false
|
214
|
+
|
215
|
+
# This is just silly. Calling the argument `other` in all cases makes no sense.
|
216
|
+
Naming/BinaryOperatorParameterName:
|
217
|
+
Enabled: false
|
metadata
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: Dutchie-Style
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Christopher Ostrowski
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-06-24 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rubocop
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.80.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.80.0
|
27
|
+
description: Rubocop Settings for all dutchie Ruby Apps
|
28
|
+
email:
|
29
|
+
- chris@dutchie.com
|
30
|
+
executables: []
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files:
|
34
|
+
- ".editorconfig"
|
35
|
+
- ".gitignore"
|
36
|
+
- Dutchie-Style.gemspec
|
37
|
+
- Gemfile
|
38
|
+
- README.md
|
39
|
+
- default.yml
|
40
|
+
- lib/Dutchie/Style.rb
|
41
|
+
- lib/Dutchie/Style/version.rb
|
42
|
+
homepage: https://github.com/GetDutchie/Dutchie-Style
|
43
|
+
licenses: []
|
44
|
+
metadata:
|
45
|
+
homepage_uri: https://github.com/GetDutchie/Dutchie-Style
|
46
|
+
source_code_uri: https://github.com/GetDutchie/Dutchie-Style
|
47
|
+
changelog_uri: https://github.com/GetDutchie/Dutchie-Style/releases
|
48
|
+
post_install_message:
|
49
|
+
rdoc_options: []
|
50
|
+
require_paths:
|
51
|
+
- lib
|
52
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: 2.3.0
|
57
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
requirements: []
|
63
|
+
rubygems_version: 3.0.3
|
64
|
+
signing_key:
|
65
|
+
specification_version: 4
|
66
|
+
summary: Rubocop Settings for all dutchie Ruby Apps
|
67
|
+
test_files: []
|