leftovers 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +4 -0
- data/.leftovers.yml +19 -0
- data/.rspec +3 -0
- data/.rubocop.yml +216 -0
- data/.ruby-version +1 -0
- data/.spellr.yml +13 -0
- data/.spellr_wordlists/english.txt +21 -0
- data/.spellr_wordlists/lorem.txt +1 -0
- data/.spellr_wordlists/ruby.txt +67 -0
- data/.spellr_wordlists/shell.txt +3 -0
- data/.travis.yml +10 -0
- data/Configuration.md +427 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +21 -0
- data/README.md +172 -0
- data/Rakefile +16 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/exe/leftovers +6 -0
- data/leftovers.gemspec +42 -0
- data/lib/config/attr_encrypted.yml +16 -0
- data/lib/config/builder.yml +3 -0
- data/lib/config/capistrano.yml +3 -0
- data/lib/config/datagrid.yml +9 -0
- data/lib/config/flipper.yml +3 -0
- data/lib/config/graphql.yml +20 -0
- data/lib/config/guard.yml +3 -0
- data/lib/config/haml.yml +2 -0
- data/lib/config/jbuilder.yml +2 -0
- data/lib/config/okcomputer.yml +3 -0
- data/lib/config/parser.yml +91 -0
- data/lib/config/pry.yml +3 -0
- data/lib/config/rack.yml +2 -0
- data/lib/config/rails.yml +387 -0
- data/lib/config/rake.yml +5 -0
- data/lib/config/redcarpet.yml +38 -0
- data/lib/config/rollbar.yml +3 -0
- data/lib/config/rspec.yml +56 -0
- data/lib/config/ruby.yml +77 -0
- data/lib/config/selenium.yml +21 -0
- data/lib/config/simplecov.yml +2 -0
- data/lib/config/will_paginate.yml +14 -0
- data/lib/leftovers/argument_rule.rb +216 -0
- data/lib/leftovers/backports.rb +56 -0
- data/lib/leftovers/cli.rb +50 -0
- data/lib/leftovers/collector.rb +67 -0
- data/lib/leftovers/config.rb +53 -0
- data/lib/leftovers/core_ext.rb +32 -0
- data/lib/leftovers/definition.rb +70 -0
- data/lib/leftovers/definition_set.rb +44 -0
- data/lib/leftovers/erb.rb +20 -0
- data/lib/leftovers/file.rb +30 -0
- data/lib/leftovers/file_collector.rb +219 -0
- data/lib/leftovers/file_list.rb +24 -0
- data/lib/leftovers/haml.rb +24 -0
- data/lib/leftovers/hash_rule.rb +40 -0
- data/lib/leftovers/merged_config.rb +71 -0
- data/lib/leftovers/name_rule.rb +53 -0
- data/lib/leftovers/node.rb +182 -0
- data/lib/leftovers/rake_task.rb +62 -0
- data/lib/leftovers/reporter.rb +11 -0
- data/lib/leftovers/rule.rb +74 -0
- data/lib/leftovers/transform_rule.rb +171 -0
- data/lib/leftovers/value_rule.rb +56 -0
- data/lib/leftovers/version.rb +5 -0
- data/lib/leftovers.rb +127 -0
- metadata +281 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 392cec9799ddf44fd1b532c714e70bdeb5bcd56d68843015fd45ab12aa747813
|
4
|
+
data.tar.gz: 2b34e3689fa2a376e83372234b936f0f9d0a4f0db1bd01f3cd4f48191f8d4f49
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a8a681a625180b33210f36f74f2d5a2da5ade1955adbf357f9feefdd03fb32ea7088a57392056d4c31d6e937f4dbde79e54547ee80323ae8dd5d16997accea49
|
7
|
+
data.tar.gz: 1679d83c75a635bf12b2978bb415ae2d5f7280b5a162df16529058af2d3b0b814762e8710704cca3f84aa75e7d4809d396ee1baaa094a618544365fe47e21f77
|
data/.gitignore
ADDED
data/.leftovers.yml
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
exclude_paths:
|
2
|
+
- /vendor
|
3
|
+
|
4
|
+
rules:
|
5
|
+
- skip: true
|
6
|
+
name:
|
7
|
+
- add_insert_cmd # called by ::ERB::Compiler
|
8
|
+
- add_put_cmd # called by ::ERB::Compiler
|
9
|
+
- Node
|
10
|
+
- name:
|
11
|
+
- RUBY_STRING_METHODS
|
12
|
+
- ACTIVESUPPORT_STRING_METHODS
|
13
|
+
- CUSTOM_TRANSFORMS
|
14
|
+
calls:
|
15
|
+
argument: 1
|
16
|
+
- name: HASH_VALUE_TRANSFORMS
|
17
|
+
calls:
|
18
|
+
argument: 1
|
19
|
+
add_suffix: _dynamic
|
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,216 @@
|
|
1
|
+
require: rubocop-rspec
|
2
|
+
|
3
|
+
# Reference:
|
4
|
+
# https://rubocop.readthedocs.io/en/latest/
|
5
|
+
|
6
|
+
# Keep this in alphabetical order.
|
7
|
+
# Each override should have a comment (even if it's just "default is bad")
|
8
|
+
|
9
|
+
AllCops:
|
10
|
+
NewCops: enable
|
11
|
+
Exclude:
|
12
|
+
- db/schema*
|
13
|
+
- .bundle/**/*
|
14
|
+
- tmp/**/*
|
15
|
+
- vendor/**/*
|
16
|
+
DisplayCopNames: true
|
17
|
+
DisplayStyleGuide: true
|
18
|
+
TargetRubyVersion: 2.4
|
19
|
+
|
20
|
+
# all of our layout customisations are because we prefer indentation to be
|
21
|
+
# always consistently 2 spaces, for blocks, scopes, multiline expressions, etc
|
22
|
+
# e.g.
|
23
|
+
# class Klass
|
24
|
+
# def method(arg1,
|
25
|
+
# arg2)
|
26
|
+
# value = if arg1 == 'value' && arg2 == 'value'
|
27
|
+
# method2
|
28
|
+
# .method(arg_a, arg_b,
|
29
|
+
# arg_c, arg_d, keyword1: true,
|
30
|
+
# keyword2: true) do
|
31
|
+
# @last = [
|
32
|
+
# arg_a, arg_b,
|
33
|
+
# arg_c, arg_d
|
34
|
+
# ]
|
35
|
+
# end
|
36
|
+
# end
|
37
|
+
# value
|
38
|
+
# end
|
39
|
+
# end
|
40
|
+
|
41
|
+
# to match our preference for consistent indentation
|
42
|
+
Layout/HashAlignment:
|
43
|
+
EnforcedLastArgumentHashStyle: always_ignore
|
44
|
+
|
45
|
+
# to match our preference for consistent indentation
|
46
|
+
Layout/ParameterAlignment:
|
47
|
+
EnforcedStyle: with_fixed_indentation
|
48
|
+
|
49
|
+
# to match our preference for consistent indentation
|
50
|
+
Layout/BlockAlignment:
|
51
|
+
EnforcedStyleAlignWith: start_of_block
|
52
|
+
|
53
|
+
# to match our preference for consistent indentation
|
54
|
+
Layout/CaseIndentation:
|
55
|
+
EnforcedStyle: end
|
56
|
+
|
57
|
+
# to match our preference for consistent indentation
|
58
|
+
Layout/EndAlignment:
|
59
|
+
EnforcedStyleAlignWith: start_of_line
|
60
|
+
|
61
|
+
# Aligning Assignments, etc makes diffs noisy
|
62
|
+
Layout/ExtraSpacing:
|
63
|
+
AllowForAlignment: false
|
64
|
+
|
65
|
+
# to match our preference for consistent indentation
|
66
|
+
Layout/FirstArrayElementLineBreak:
|
67
|
+
Enabled: true
|
68
|
+
|
69
|
+
# to match our preference for consistent indentation
|
70
|
+
Layout/FirstHashElementLineBreak:
|
71
|
+
Enabled: true
|
72
|
+
|
73
|
+
# to match our preference for consistent indentation
|
74
|
+
Layout/FirstArgumentIndentation:
|
75
|
+
EnforcedStyle: consistent
|
76
|
+
|
77
|
+
# to match our preference for consistent indentation
|
78
|
+
Layout/FirstArrayElementIndentation:
|
79
|
+
EnforcedStyle: consistent
|
80
|
+
|
81
|
+
# to match our preference for consistent indentation
|
82
|
+
Layout/FirstHashElementIndentation:
|
83
|
+
EnforcedStyle: consistent
|
84
|
+
|
85
|
+
# to match our preference for consistent indentation
|
86
|
+
# and hanging assignment looks lost
|
87
|
+
Layout/MultilineAssignmentLayout:
|
88
|
+
EnforcedStyle: same_line
|
89
|
+
|
90
|
+
# this changes our preferred:
|
91
|
+
# value = if thing1 &&
|
92
|
+
# thing2
|
93
|
+
# to:
|
94
|
+
# value = if thing1 &&
|
95
|
+
# thing2
|
96
|
+
# even though the IndentationWidth is 2
|
97
|
+
# but it's right most of the time so I put up with it
|
98
|
+
Layout/MultilineOperationIndentation:
|
99
|
+
EnforcedStyle: indented
|
100
|
+
|
101
|
+
Layout/MultilineMethodCallIndentation:
|
102
|
+
EnforcedStyle: indented
|
103
|
+
|
104
|
+
# Temporarily disable this spec as a recent change has broken it for us:
|
105
|
+
# https://github.com/rubocop-hq/rubocop/issues/6254
|
106
|
+
Layout/RescueEnsureAlignment:
|
107
|
+
Enabled: false
|
108
|
+
|
109
|
+
Metrics:
|
110
|
+
CountComments: false
|
111
|
+
|
112
|
+
Metrics/BlockLength:
|
113
|
+
ExcludedMethods:
|
114
|
+
- configure
|
115
|
+
- describe
|
116
|
+
- context
|
117
|
+
- it
|
118
|
+
|
119
|
+
Layout/LineLength:
|
120
|
+
Max: 100
|
121
|
+
IgnoreCopDirectives: true
|
122
|
+
|
123
|
+
Metrics/MethodLength:
|
124
|
+
Max: 5
|
125
|
+
|
126
|
+
Naming/MethodParameterName:
|
127
|
+
AllowedNames: [_, io, id, to, by, 'on', in, at, ip, db]
|
128
|
+
|
129
|
+
RSpec:
|
130
|
+
Enabled: true
|
131
|
+
Include:
|
132
|
+
- spec/**/*.rb
|
133
|
+
|
134
|
+
RSpec/DescribeClass:
|
135
|
+
Enabled: false
|
136
|
+
|
137
|
+
RSpec/ExampleLength:
|
138
|
+
Enabled: false
|
139
|
+
|
140
|
+
# I misuse matchers often
|
141
|
+
RSpec/ExpectActual:
|
142
|
+
Enabled: false
|
143
|
+
|
144
|
+
RSpec/FilePath:
|
145
|
+
Enabled: false
|
146
|
+
|
147
|
+
# Multiple expectations are useful
|
148
|
+
# checking you've partially achieved something on the way to completely achieving it is useful for debugging failures
|
149
|
+
RSpec/MultipleExpectations:
|
150
|
+
Enabled: false
|
151
|
+
|
152
|
+
# It should be obvious from context. Chill out rubocop
|
153
|
+
RSpec/NamedSubject:
|
154
|
+
Enabled: false
|
155
|
+
|
156
|
+
|
157
|
+
# This matches the style we've been using all along (ever so slightly more frequently)
|
158
|
+
Style/Alias:
|
159
|
+
EnforcedStyle: prefer_alias_method
|
160
|
+
|
161
|
+
Style/CollectionMethods:
|
162
|
+
Enabled: true
|
163
|
+
|
164
|
+
# we don't rdoc
|
165
|
+
Style/Documentation:
|
166
|
+
Enabled: false
|
167
|
+
|
168
|
+
# [a, b].include?(x) is more unclear than a == x || b == x
|
169
|
+
Style/MultipleComparison:
|
170
|
+
Enabled: false
|
171
|
+
|
172
|
+
Style/NumericPredicate:
|
173
|
+
Enabled: false
|
174
|
+
|
175
|
+
# we use %w{} pretty frequently
|
176
|
+
Style/PercentLiteralDelimiters:
|
177
|
+
PreferredDelimiters:
|
178
|
+
default: '{}'
|
179
|
+
'%w': '{}'
|
180
|
+
'%W': '{}'
|
181
|
+
'%i': '{}'
|
182
|
+
'%I': '{}'
|
183
|
+
'%r': '{}'
|
184
|
+
|
185
|
+
# We want this to warn to force consistency within the codebase.
|
186
|
+
Style/SafeNavigation:
|
187
|
+
Enabled: true
|
188
|
+
|
189
|
+
# different methods calls that do exactly the same thing are a smell, regardless of semantics
|
190
|
+
Style/SignalException:
|
191
|
+
EnforcedStyle: only_raise
|
192
|
+
|
193
|
+
# this wants less descriptive names
|
194
|
+
Style/SingleLineBlockParams:
|
195
|
+
Enabled: false
|
196
|
+
|
197
|
+
Style/HashEachMethods:
|
198
|
+
Enabled: true
|
199
|
+
Style/HashTransformKeys:
|
200
|
+
Enabled: true
|
201
|
+
Style/HashTransformValues:
|
202
|
+
Enabled: true
|
203
|
+
Lint/RaiseException:
|
204
|
+
Enabled: true
|
205
|
+
Lint/StructNewOverride:
|
206
|
+
Enabled: true
|
207
|
+
|
208
|
+
# hey rubocop you even use parser which uses :true and :false types. no
|
209
|
+
Lint/BooleanSymbol:
|
210
|
+
Enabled: false
|
211
|
+
|
212
|
+
Style/DoubleNegation:
|
213
|
+
Enabled: false
|
214
|
+
|
215
|
+
RSpec/InstanceVariable:
|
216
|
+
Enabled: false # I'll figure it out soon
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.5.1
|
data/.spellr.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
baz
|
@@ -0,0 +1,67 @@
|
|
1
|
+
activesupport
|
2
|
+
asgn
|
3
|
+
ast
|
4
|
+
autolink
|
5
|
+
bigint
|
6
|
+
camelcase
|
7
|
+
camelize
|
8
|
+
capfile
|
9
|
+
casgn
|
10
|
+
cattr
|
11
|
+
changelog
|
12
|
+
codespan
|
13
|
+
configs
|
14
|
+
coverband
|
15
|
+
csend
|
16
|
+
cvasgn
|
17
|
+
cyclomatic
|
18
|
+
deconstantize
|
19
|
+
demodulize
|
20
|
+
diffable
|
21
|
+
dstr
|
22
|
+
dsym
|
23
|
+
eflipflop
|
24
|
+
encryptor
|
25
|
+
gitignore
|
26
|
+
guardfile
|
27
|
+
gvasgn
|
28
|
+
haml
|
29
|
+
hrule
|
30
|
+
iflipflop
|
31
|
+
irange
|
32
|
+
ivasgn
|
33
|
+
jbuilder
|
34
|
+
kwbegin
|
35
|
+
kwoptarg
|
36
|
+
kwrestarg
|
37
|
+
linebreak
|
38
|
+
lvars
|
39
|
+
lvasgn
|
40
|
+
masgn
|
41
|
+
mattr
|
42
|
+
memoizations
|
43
|
+
optarg
|
44
|
+
postexe
|
45
|
+
postprocess
|
46
|
+
precompile
|
47
|
+
preexe
|
48
|
+
preload
|
49
|
+
procarg
|
50
|
+
pryrc
|
51
|
+
regexps
|
52
|
+
resbody
|
53
|
+
restarg
|
54
|
+
rhtml
|
55
|
+
rjs
|
56
|
+
rspec
|
57
|
+
rubocop
|
58
|
+
shadowarg
|
59
|
+
simplecov
|
60
|
+
strikethrough
|
61
|
+
subnodes
|
62
|
+
syms
|
63
|
+
titlecase
|
64
|
+
titleize
|
65
|
+
usr
|
66
|
+
vasgn
|
67
|
+
xstr
|