ted_rubocop_rules 0.1.0.pre.alpha.2 → 0.1.0.pre.alpha.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a89446897c30ea9a35b516cbd83ff5563a608e2809e91e577e5bb30cc87c849
4
- data.tar.gz: f01d689919683fb93978fca1a78c4888ff313400dded41c7dc95d7da93d05274
3
+ metadata.gz: ced962e19ac9820623315af934e919d1e27c0835a1e5f33deaba8ad06c1114e1
4
+ data.tar.gz: dc098e02d14357e706882820465311021cefa919642c9fc3e0b463d2780cbef9
5
5
  SHA512:
6
- metadata.gz: c3797b219f98ca278619c8edecd8412ce037123afe915d815d9e05116463e409ce393edac6b3c21925f365cb0c16e7e2e36c40acc62a23c58720db553d1cd4e7
7
- data.tar.gz: 7473c858584043fbee8b03374082b408a072c9a35fa5ea0943b4f8985ee6ddf24bad645d41bd8e82f743034fd0d0af7e3baec74e48a3c4151062336a2c27a461
6
+ metadata.gz: 43b00cabb4da6981e5b6a464da9b20472ae7c4a964de64f7aaa138745ed09c8dd138f6dd446b9cce9a1189cc8217f6fd19b2cc016be04e6244b4948eb07df4e3
7
+ data.tar.gz: fa5571abc5fb800de9d359f3fd2e5480f4bd6c5248542e17453ba498420679bdbd9db512b23dd22f2efaa038ff5284ddfcb1378ebd8c8e72aa57bcd94f7a34e6
@@ -1,3 +1,3 @@
1
1
  module TedRubocopRules
2
- VERSION = "0.1.0-alpha.2"
2
+ VERSION = "0.1.0-alpha.3"
3
3
  end
@@ -0,0 +1,277 @@
1
+ # Check README.md for usage & style conventions.
2
+
3
+ AllCops:
4
+ # we will opt-in to the rules we want.
5
+ DisabledByDefault: true
6
+ DisplayCopNames: true
7
+
8
+ # Rubocop caches results per file, to speed up if the file is unchange. If we
9
+ # don't limit this, it can eat disk space:
10
+ # https://www.flowdock.com/app/ted/roadrunner/threads/e0sOqMR1lm1jQ7MEQxB4HgyJANM
11
+ MaxFilesInCache: 30
12
+
13
+ # don't check style on generated files.
14
+ Exclude:
15
+ - 'tmp/**/*'
16
+ - 'db/schema.rb'
17
+ - 'bin/*'
18
+ - 'spec/dummy/db/schema.rb'
19
+ - 'spec/dummy/bin/*'
20
+ - 'app/models/protobuf/**/*'
21
+ - 'node_modules/**/*'
22
+ - 'bower_components/**/*'
23
+
24
+ # DRY your Gemfile
25
+ Bundler/DuplicatedGem:
26
+ Enabled: true
27
+ Severity: warning
28
+
29
+ # alphabetize your Gemfile.
30
+ # if you like grouping them logically, a comment will be interpreted as the
31
+ # beginning of a new list.
32
+ Bundler/OrderedGems:
33
+ Enabled: true
34
+ Severity: warning
35
+ TreatCommentsAsGroupSeparators: true
36
+
37
+ # codifying current rubocop defaults
38
+ # establish our own baseline in case the project's defaults are changed
39
+ #
40
+ # flagging this as 'refactor'-level because they're so arbitrary
41
+ # tempted to do the same for cyclomatic complexity, perceived complexity, etc.
42
+ # will hold off on that for now, but PRs/discussion are welcome.
43
+ Metrics/AbcSize:
44
+ Enabled: true
45
+ Max: 25
46
+ Severity: refactor
47
+
48
+ # writing long var names as a way of self-documenting shouldn't be discouraged
49
+ # also allowing URLs & etc so as not to require artifically breaking apart
50
+ # non-code strings. (this is current default already, but let's be explicit.)
51
+ #
52
+ # "It's like writing on a roll of toilet paper." - George Riley
53
+ Layout/LineLength:
54
+ AllowHeredoc: true
55
+ AllowURI: true
56
+ Enabled: true
57
+ Max: 100
58
+ Severity: warning
59
+ URISchemes:
60
+ - http
61
+ - https
62
+
63
+ Metrics/MethodLength:
64
+ Enabled: true
65
+ Max: 25
66
+ Severity: refactor
67
+
68
+ # expect {
69
+ # a_thing
70
+ # }.to raise_error
71
+ #
72
+ # is fine.
73
+ Style/BlockDelimiters:
74
+ Enabled: true
75
+ EnforcedStyle: braces_for_chaining
76
+ Severity: warning
77
+
78
+ # comments explaining the purpose of a class are a good thing.
79
+ # but they're unecessary in a few cases:
80
+ #
81
+ # - migration classes. the purpose of a migration is obvious.
82
+ # - classes in a dummy application.
83
+ Style/Documentation:
84
+ Enabled: true
85
+ Severity: warning
86
+ Exclude:
87
+ - 'db/migrate/*'
88
+ - 'spec/dummy/**/*'
89
+
90
+ # Having a lot of code in a block is probably not a great thing. But in specs,
91
+ # it's actually great, because spec frameworks like RSpec use blocks to define
92
+ # scopes of specs. It seems like specs are not what this rule was aimed at.
93
+ #
94
+ # RSpec.describe User do
95
+ # # All your specs go in here.
96
+ # end
97
+ #
98
+ # Same goes for routes - those blocks can get pretty long.
99
+ # Borrowed from https://github.com/NobodysNightmare/rubocop/commit/99124543155b728b495560ab9e2a88ff597e1899#diff-e93280b3b31a6438c533a5f3232340d8R1179
100
+ Metrics/BlockLength:
101
+ Enabled: true
102
+ Severity: warning
103
+ ExcludedMethods:
104
+ - context
105
+ - describe
106
+ - it
107
+ - shared_examples
108
+ - shared_examples_for
109
+ - namespace
110
+ - draw
111
+ - define # for FactoryBot
112
+ - factory # for FactoryBot
113
+ - xdescribe
114
+ - xit
115
+
116
+ # cribbed from https://github.com/rails/rails/blob/1f7f872ac6c8b57af6e0117bde5f6c38d0bae923/.rubocop.yml
117
+
118
+ # Prefer &&/|| over and/or.
119
+ Style/AndOr:
120
+ Enabled: true
121
+ Severity: warning
122
+
123
+ # Indent private/protected/public as deep as method definitions
124
+ Layout/AccessModifierIndentation:
125
+ Enabled: true
126
+ Severity: warning
127
+
128
+ # Align `when` with `case`.
129
+ Layout/CaseIndentation:
130
+ Enabled: true
131
+ Severity: warning
132
+
133
+ # Align comments with method definitions.
134
+ Layout/CommentIndentation:
135
+ Enabled: true
136
+ Severity: warning
137
+
138
+ # Multi-line method chaining should be done with leading dots.
139
+ # Layout/DotPosition:
140
+ # Enabled: true # pending more consensus
141
+ # Severity: warning
142
+
143
+ Layout/EmptyLineAfterMagicComment:
144
+ Enabled: true
145
+ Severity: warning
146
+
147
+ # No extra empty lines.
148
+ Layout/EmptyLines:
149
+ Enabled: true
150
+ Severity: warning
151
+
152
+ # In a regular class definition, no empty lines around the body.
153
+ Layout/EmptyLinesAroundClassBody:
154
+ Enabled: true
155
+ Severity: warning
156
+
157
+ # In a regular method definition, no empty lines around the body.
158
+ Layout/EmptyLinesAroundMethodBody:
159
+ Enabled: true
160
+ Severity: warning
161
+
162
+ # In a regular module definition, no empty lines around the body.
163
+ Layout/EmptyLinesAroundModuleBody:
164
+ Enabled: true
165
+ Severity: warning
166
+
167
+ Layout/FirstArgumentIndentation:
168
+ Enabled: true
169
+ Severity: warning
170
+
171
+ # Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
172
+ Style/HashSyntax:
173
+ Enabled: true
174
+ Severity: warning
175
+
176
+ # Indent consistently, who doesn't like that?
177
+ Layout/IndentationConsistency:
178
+ Enabled: true
179
+ Severity: warning
180
+
181
+ # Two spaces, no tabs (for indentation).
182
+ Layout/IndentationWidth:
183
+ Enabled: true
184
+ Severity: warning
185
+
186
+ Layout/SpaceAfterColon:
187
+ Enabled: true
188
+ Severity: warning
189
+
190
+ Layout/SpaceAfterComma:
191
+ Enabled: true
192
+ Severity: warning
193
+
194
+ Layout/SpaceAroundEqualsInParameterDefault:
195
+ Enabled: true
196
+ Severity: warning
197
+
198
+ Layout/SpaceAroundKeyword:
199
+ Enabled: true
200
+ Severity: warning
201
+
202
+ Layout/SpaceAroundOperators:
203
+ Enabled: true
204
+ Severity: warning
205
+
206
+ Layout/SpaceBeforeFirstArg:
207
+ Enabled: true
208
+ Severity: warning
209
+
210
+ # Defining a method with parameters needs parentheses.
211
+ Style/MethodDefParentheses:
212
+ Enabled: true
213
+ Severity: warning
214
+
215
+ # Use `foo {}` not `foo{}`.
216
+ Layout/SpaceBeforeBlockBraces:
217
+ Enabled: true
218
+ Severity: warning
219
+
220
+ # Use `foo { bar }` not `foo {bar}`.
221
+ Layout/SpaceInsideBlockBraces:
222
+ Enabled: true
223
+ Severity: warning
224
+
225
+ # Use `{ a: 1 }` not `{a:1}`.
226
+ Layout/SpaceInsideHashLiteralBraces:
227
+ Enabled: true
228
+ Severity: warning
229
+
230
+ Layout/SpaceInsideParens:
231
+ Enabled: true
232
+ Severity: warning
233
+
234
+ # Check quotes usage according to lint rule below.
235
+ # Style/StringLiterals:
236
+ # Enabled: true # pending more consensus
237
+ # Severity: warning
238
+
239
+ # Detect hard tabs, no hard tabs.
240
+ Layout/IndentationStyle:
241
+ Enabled: true
242
+ Severity: warning
243
+
244
+ # Blank lines should not have any spaces.
245
+ Layout/TrailingEmptyLines:
246
+ Enabled: true
247
+ Severity: warning
248
+
249
+ # No trailing whitespace.
250
+ Layout/TrailingWhitespace:
251
+ Enabled: true
252
+ Severity: warning
253
+
254
+ # Use quotes for string literals when they are enough.
255
+ Style/RedundantPercentQ:
256
+ Enabled: true
257
+ Severity: warning
258
+
259
+ Style/StabbyLambdaParentheses:
260
+ Enabled: true
261
+ EnforcedStyle: require_parentheses
262
+ Severity: warning
263
+
264
+ Style/SignalException:
265
+ Enabled: true
266
+ EnforcedStyle: only_raise
267
+ Severity: warning
268
+
269
+ # point out assignments to unused variables
270
+ Lint/UselessAssignment:
271
+ Enabled: true
272
+ Severity: refactor
273
+
274
+ # Throw a warning if someone leaves a `byebug` in the code
275
+ Lint/Debugger:
276
+ Enabled: true
277
+ Severity: warning
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ted_rubocop_rules
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre.alpha.2
4
+ version: 0.1.0.pre.alpha.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Dean
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '10.0'
47
+ version: '13.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '10.0'
54
+ version: '13.0'
55
55
  description: TED rubocop rules as a gem.
56
56
  email:
57
57
  - github@mostlyalex.com
@@ -59,11 +59,8 @@ executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
- - ".gitignore"
63
- - Gemfile
64
- - Rakefile
65
62
  - lib/ted_rubocop_rules/version.rb
66
- - ted_rubocop_rules.gemspec
63
+ - rubocop.yml
67
64
  homepage: https://github.com/tedconf/code-style-guides/gem
68
65
  licenses: []
69
66
  metadata: {}
data/.gitignore DELETED
@@ -1,8 +0,0 @@
1
- /.yardoc
2
- /_yardoc/
3
- /coverage/
4
- /doc/
5
- /pkg/
6
- /spec/reports/
7
- /tmp/
8
- Gemfile.lock
data/Gemfile DELETED
@@ -1,6 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
-
5
- # Specify your gem's dependencies in ted_rubocop_rules.gemspec
6
- gemspec
data/Rakefile DELETED
@@ -1,26 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "yaml"
3
-
4
- task :default => :spec
5
-
6
- task :build do
7
- this_dir = Pathname.new(File.expand_path('../', __FILE__))
8
-
9
- source_file = this_dir.join('../linters/rubocop/rubocop.yml')
10
- target_file = this_dir.join('rubocop.yml')
11
-
12
- # be sure syntax is valid.
13
- YAML.load_file source_file
14
-
15
- # this will be a nuisance if you're doing repeated builds. sorry 'bout that.
16
- #
17
- # goal is to prevent people from inadvertently editing gem/rubocop.yml and
18
- # having those edits wiped out by the build process. (a mistake which they
19
- # might not notice until much later.)
20
- if File.exist?(target_file)
21
- raise "Please remove #{target_file} before building. Make any edits in #{source_file} instead."
22
- end
23
-
24
- # go ahead & copy if everything looks ok.
25
- `cp #{source_file} #{target_file}`
26
- end
@@ -1,26 +0,0 @@
1
-
2
- lib = File.expand_path("../lib", __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require "ted_rubocop_rules/version"
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "ted_rubocop_rules"
8
- spec.version = TedRubocopRules::VERSION
9
- spec.authors = ["Alex Dean"]
10
- spec.email = ["github@mostlyalex.com"]
11
-
12
- spec.summary = %q{TED rubocop rules as a gem.}
13
- spec.description = %q{TED rubocop rules as a gem.}
14
- spec.homepage = "https://github.com/tedconf/code-style-guides/gem"
15
-
16
- # Specify which files should be added to the gem when it is released.
17
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
18
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
19
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
20
- end
21
- spec.require_paths = ["lib"]
22
-
23
- spec.add_dependency "rubocop", "= 0.86.0"
24
- spec.add_development_dependency "bundler", "~> 1.17"
25
- spec.add_development_dependency "rake", "~> 10.0"
26
- end