Skip to content

Commit b7ef4a6

Browse files
committed
Migrate linter to rubocop-rails-omakase
1 parent 00c555e commit b7ef4a6

27 files changed

+65
-280
lines changed

.rubocop.yml

Lines changed: 11 additions & 230 deletions
Original file line numberDiff line numberDiff line change
@@ -1,244 +1,25 @@
1-
require: rubocop-rails
1+
# Omakase Ruby styling for Rails
2+
inherit_gem:
3+
rubocop-rails-omakase: rubocop.yml
24

5+
# Your own specialized rules go here
36
AllCops:
47
Exclude:
5-
- db/schema.rb
8+
- "db/**/*"
9+
- "config/**/*"
610

7-
Naming/AccessorMethodName:
11+
Layout/SpaceInsideArrayLiteralBrackets:
812
Enabled: false
9-
10-
Rails/HttpPositionalArguments:
11-
Enabled: true
12-
13-
Style/Alias:
14-
Enabled: false
15-
16-
Style/ArrayJoin:
17-
Enabled: false
18-
19-
Style/AsciiComments:
20-
Enabled: false
21-
22-
Naming/AsciiIdentifiers:
23-
Enabled: false
24-
25-
Style/Attr:
26-
Enabled: false
27-
28-
Metrics/BlockNesting:
29-
Enabled: false
30-
31-
Style/CaseEquality:
32-
Enabled: false
33-
34-
Style/CharacterLiteral:
35-
Enabled: false
36-
37-
Style/ClassAndModuleChildren:
13+
Layout/SpaceInsidePercentLiteralDelimiters:
3814
Enabled: false
39-
40-
Metrics/ClassLength:
41-
Enabled: false
42-
43-
Style/ClassVars:
44-
Enabled: false
45-
46-
Style/CollectionMethods:
47-
PreferredMethods:
48-
find: detect
49-
reduce: inject
50-
collect: map
51-
find_all: select
52-
53-
Style/ColonMethodCall:
54-
Enabled: false
55-
56-
Style/CommentAnnotation:
57-
Enabled: false
58-
59-
Metrics/CyclomaticComplexity:
15+
Layout/CaseIndentation:
6016
Enabled: false
61-
62-
Style/Documentation:
17+
Layout/EndAlignment:
6318
Enabled: false
64-
65-
Layout/DotPosition:
66-
EnforcedStyle: trailing
67-
68-
Layout/ConditionPosition:
69-
Enabled: false
70-
71-
Style/DoubleNegation:
72-
Enabled: false
73-
74-
Style/EachWithObject:
75-
Enabled: false
76-
77-
Style/EmptyLiteral:
78-
Enabled: false
79-
80-
Style/Encoding:
81-
Enabled: false
82-
83-
Style/EvenOdd:
84-
Enabled: false
85-
86-
Naming/FileName:
87-
Enabled: false
88-
89-
Style/FormatString:
90-
Enabled: false
91-
92-
Style/GlobalVars:
93-
Enabled: false
94-
95-
Style/GuardClause:
96-
Enabled: false
97-
98-
Style/IfUnlessModifier:
99-
Enabled: false
100-
101-
Style/IfWithSemicolon:
102-
Enabled: false
103-
104-
Style/InlineComment:
105-
Enabled: false
106-
107-
Style/Lambda:
108-
Enabled: false
109-
110-
Style/LambdaCall:
111-
Enabled: false
112-
113-
Style/LineEndConcatenation:
114-
Enabled: false
115-
116-
Layout/LineLength:
117-
Max: 100
118-
119-
Metrics/MethodLength:
120-
Enabled: false
121-
122-
Style/ModuleFunction:
123-
Enabled: false
124-
125-
Style/NegatedIf:
126-
Enabled: false
127-
128-
Style/NegatedWhile:
129-
Enabled: false
130-
131-
Style/Next:
132-
Enabled: false
133-
134-
Style/NilComparison:
135-
Enabled: false
136-
137-
Style/Not:
138-
Enabled: false
139-
140-
Style/NumericLiterals:
141-
Enabled: false
142-
143-
Style/OneLineConditional:
144-
Enabled: false
145-
146-
Metrics/ParameterLists:
19+
Layout/ElseAlignment:
14720
Enabled: false
14821

14922
Style/PercentLiteralDelimiters:
15023
Enabled: false
151-
152-
Style/PerlBackrefs:
153-
Enabled: false
154-
155-
Naming/PredicateName:
156-
ForbiddenPrefixes:
157-
- is_
158-
159-
Style/Proc:
160-
Enabled: false
161-
162-
Style/RaiseArgs:
163-
Enabled: false
164-
165-
Style/RegexpLiteral:
166-
Enabled: false
167-
168-
Style/SelfAssignment:
169-
Enabled: false
170-
171-
Style/SingleLineBlockParams:
172-
Enabled: false
173-
174-
Style/SingleLineMethods:
175-
Enabled: false
176-
177-
Style/SignalException:
178-
Enabled: false
179-
180-
Style/SpecialGlobalVars:
181-
Enabled: false
182-
18324
Style/StringLiterals:
184-
EnforcedStyle: double_quotes
185-
186-
Style/VariableInterpolation:
187-
Enabled: false
188-
189-
Style/TrailingCommaInArrayLiteral:
190-
Enabled: false
191-
192-
Style/TrailingCommaInHashLiteral:
193-
Enabled: false
194-
195-
Style/TrailingCommaInArguments:
196-
Enabled: false
197-
198-
Style/TrivialAccessors:
199-
Enabled: false
200-
201-
Style/WhenThen:
202-
Enabled: false
203-
204-
Style/WhileUntilModifier:
205-
Enabled: false
206-
207-
Lint/AmbiguousOperator:
208-
Enabled: false
209-
210-
Lint/AmbiguousRegexpLiteral:
211-
Enabled: false
212-
213-
Lint/AssignmentInCondition:
214-
Enabled: false
215-
216-
Lint/DeprecatedClassMethods:
217-
Enabled: false
218-
219-
Lint/ElseLayout:
220-
Enabled: false
221-
222-
Lint/SuppressedException:
223-
Enabled: false
224-
225-
Lint/LiteralInInterpolation:
226-
Enabled: false
227-
228-
Lint/Loop:
229-
Enabled: false
230-
231-
Lint/ParenthesesAsGroupedExpression:
232-
Enabled: false
233-
234-
Lint/RequireParentheses:
235-
Enabled: false
236-
237-
Lint/UnderscorePrefixedVariableName:
238-
Enabled: false
239-
240-
Lint/Void:
241-
Enabled: false
242-
243-
Lint/FlipFlop:
24425
Enabled: false

Gemfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ end
4545

4646
group :development, :test do
4747
gem 'byebug', '~> 11.0'
48-
gem 'rubocop', '~> 1.6', require: false
49-
gem 'rubocop-rails', '~> 2.9', require: false
48+
gem 'rubocop-rails-omakase', require: false
5049
gem 'dotenv-rails', '~> 3.1.7'
5150
end
5251

Gemfile.lock

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ GEM
9292
arbre (1.7.0)
9393
activesupport (>= 3.0.0)
9494
ruby2_keywords (>= 0.0.2)
95-
ast (2.4.2)
95+
ast (2.4.3)
9696
autoprefixer-rails (10.4.19.0)
9797
execjs (~> 2)
9898
aws-eventstream (1.3.0)
@@ -206,7 +206,7 @@ GEM
206206
rails-dom-testing (>= 1, < 3)
207207
railties (>= 4.2.0)
208208
thor (>= 0.14, < 2.0)
209-
json (2.9.1)
209+
json (2.10.2)
210210
json_translate (4.0.1)
211211
activerecord (>= 4.2.0)
212212
kaminari (1.2.2)
@@ -221,11 +221,12 @@ GEM
221221
activerecord
222222
kaminari-core (= 1.2.2)
223223
kaminari-core (1.2.2)
224-
language_server-protocol (3.17.0.3)
224+
language_server-protocol (3.17.0.4)
225225
launchy (2.5.2)
226226
addressable (~> 2.8)
227227
letter_opener (1.7.0)
228228
launchy (~> 2.2)
229+
lint_roller (1.1.0)
229230
localeapp (3.3.0)
230231
gli
231232
i18n (>= 0.7, < 2)
@@ -267,7 +268,7 @@ GEM
267268
racc (~> 1.4)
268269
orm_adapter (0.5.0)
269270
parallel (1.26.3)
270-
parser (3.3.6.0)
271+
parser (3.3.7.2)
271272
ast (~> 2.4.1)
272273
racc
273274
pdf-core (0.10.0)
@@ -378,23 +379,33 @@ GEM
378379
rspec-mocks (~> 3.13)
379380
rspec-support (~> 3.13)
380381
rspec-support (3.13.2)
381-
rubocop (1.69.2)
382+
rubocop (1.74.0)
382383
json (~> 2.3)
383-
language_server-protocol (>= 3.17.0)
384+
language_server-protocol (~> 3.17.0.2)
385+
lint_roller (~> 1.1.0)
384386
parallel (~> 1.10)
385387
parser (>= 3.3.0.2)
386388
rainbow (>= 2.2.2, < 4.0)
387389
regexp_parser (>= 2.9.3, < 3.0)
388-
rubocop-ast (>= 1.36.2, < 2.0)
390+
rubocop-ast (>= 1.38.0, < 2.0)
389391
ruby-progressbar (~> 1.7)
390392
unicode-display_width (>= 2.4.0, < 4.0)
391-
rubocop-ast (1.37.0)
392-
parser (>= 3.3.1.0)
393-
rubocop-rails (2.28.0)
393+
rubocop-ast (1.41.0)
394+
parser (>= 3.3.7.2)
395+
rubocop-performance (1.24.0)
396+
lint_roller (~> 1.1)
397+
rubocop (>= 1.72.1, < 2.0)
398+
rubocop-ast (>= 1.38.0, < 2.0)
399+
rubocop-rails (2.30.3)
394400
activesupport (>= 4.2.0)
401+
lint_roller (~> 1.1)
395402
rack (>= 1.1)
396-
rubocop (>= 1.52.0, < 2.0)
397-
rubocop-ast (>= 1.31.1, < 2.0)
403+
rubocop (>= 1.72.1, < 2.0)
404+
rubocop-ast (>= 1.38.0, < 2.0)
405+
rubocop-rails-omakase (1.1.0)
406+
rubocop (>= 1.72)
407+
rubocop-performance (>= 1.24)
408+
rubocop-rails (>= 2.30)
398409
ruby-progressbar (1.13.0)
399410
ruby-vips (2.2.2)
400411
ffi (~> 1.12)
@@ -453,7 +464,7 @@ GEM
453464
concurrent-ruby (~> 1.0)
454465
uglifier (4.2.1)
455466
execjs (>= 0.3.0, < 3)
456-
unicode-display_width (3.1.3)
467+
unicode-display_width (3.1.4)
457468
unicode-emoji (~> 4.0, >= 4.0.4)
458469
unicode-emoji (4.0.4)
459470
useragent (0.16.11)
@@ -513,8 +524,7 @@ DEPENDENCIES
513524
rails-i18n (~> 7.0)
514525
rdiscount (~> 2.2.7)
515526
rspec-rails (~> 6.0)
516-
rubocop (~> 1.6)
517-
rubocop-rails (~> 2.9)
527+
rubocop-rails-omakase
518528
rubyzip (~> 2.3.0)
519529
sassc-rails (~> 2.1.2)
520530
select2-rails (~> 4.0.13)

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,18 @@ In order to configure the application you can use the following ENV variables:
101101

102102
Any kind of feedback, bug report, idea or enhancement are really appreciated.
103103

104-
To contribute, just fork the repo, hack on it and send a pull request. Don't forget to add tests for behaviour changes and run the test suite:
104+
To contribute, just fork the repo, hack on it and send a pull request. Don't forget to add tests for behaviour changes and run the test suite by:
105105

106106
```
107107
bundle exec rspec
108108
```
109109

110+
You can also run the linter by:
111+
112+
```
113+
bundle exec rubocop
114+
```
115+
110116
👉 Further information in our [Wiki](https://github.com/coopdevs/timeoverflow/wiki).
111117

112118
## License

app/controllers/concerns/with_transfer_params.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ def transfer_params
44
:destination,
55
:amount,
66
:reason,
7-
:post_id,
7+
:post_id
88
]
99

1010
permitted_transfer_params.push(:source) if admin?

0 commit comments

Comments
 (0)