Skip to content

Commit 2ec5905

Browse files
authored
fix: revert back to rubocop (#46)
1 parent 0f8604f commit 2ec5905

File tree

6 files changed

+358
-5
lines changed

6 files changed

+358
-5
lines changed

.github/workflows/.rubocop.yml

Lines changed: 353 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,353 @@
1+
# The rules defined here are based on Rails:
2+
# https://raw.githubusercontent.com/rails/rails/master/.rubocop.yml
3+
# But with some modifications to fit our needs.
4+
5+
require:
6+
- rubocop-rails
7+
- rubocop-capybara
8+
- rubocop-minitest
9+
- rubocop-performance
10+
11+
AllCops:
12+
TargetRubyVersion: 3.0
13+
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
14+
# to ignore them, so only the ones explicitly set in this file are enabled.
15+
DisabledByDefault: true
16+
SuggestExtensions: false
17+
Exclude:
18+
- '**/tmp/**/*'
19+
- '**/vendor/**/*'
20+
- '**/node_modules/**/*'
21+
- 'bin/*'
22+
- 'native/**/*'
23+
24+
Performance:
25+
Exclude:
26+
- '**/test/**/*'
27+
28+
# Method definitions after `private` or `protected` isolated calls do NOT
29+
# need extra level of indentation.
30+
Layout/IndentationConsistency:
31+
Enabled: true
32+
33+
# Detect hard tabs, no hard tabs
34+
Layout/IndentationStyle:
35+
Enabled: true
36+
37+
# Four spaces, no tabs (for indentation)
38+
Layout/IndentationWidth:
39+
Enabled: true
40+
Width: 2
41+
Exclude:
42+
- '**/test/**/*'
43+
44+
# No spaces at the end of a line
45+
Layout/TrailingWhitespace:
46+
Enabled: true
47+
48+
# Prefer Foo.method over Foo::method
49+
Style/ColonMethodCall:
50+
Enabled: true
51+
52+
# Prefer brackets for array of symbols
53+
Style/SymbolArray:
54+
Enabled: true
55+
EnforcedStyle: brackets
56+
Include:
57+
- 'routes.rb'
58+
- 'app/controllers/**/*'
59+
60+
# Rules below this line are disabled
61+
62+
# Prefer assert_not over assert !
63+
Rails/AssertNot:
64+
Enabled: false
65+
Include:
66+
- '**/test/**/*'
67+
68+
# Prefer assert_not_x over refute_x
69+
Rails/RefuteMethods:
70+
Enabled: false
71+
Include:
72+
- '**/test/**/*'
73+
74+
Rails/IndexBy:
75+
Enabled: false
76+
77+
Rails/IndexWith:
78+
Enabled: false
79+
80+
# Prefer &&/|| over and/or.
81+
Style/AndOr:
82+
Enabled: false
83+
84+
# Align `when` with `case`.
85+
Layout/CaseIndentation:
86+
Enabled: false
87+
88+
Layout/ClosingHeredocIndentation:
89+
Enabled: false
90+
91+
Layout/ClosingParenthesisIndentation:
92+
Enabled: false
93+
94+
# Align comments with method definitions.
95+
Layout/CommentIndentation:
96+
Enabled: false
97+
98+
Layout/ElseAlignment:
99+
Enabled: false
100+
101+
# Align `end` with the matching keyword or starting expression except for
102+
# assignments, where it should be aligned with the LHS.
103+
Layout/EndAlignment:
104+
Enabled: false
105+
EnforcedStyleAlignWith: variable
106+
AutoCorrect: true
107+
108+
Layout/EndOfLine:
109+
Enabled: false
110+
111+
Layout/EmptyLineAfterMagicComment:
112+
Enabled: false
113+
114+
Layout/EmptyLinesAroundAccessModifier:
115+
Enabled: false
116+
EnforcedStyle: only_before
117+
118+
Layout/EmptyLinesAroundBlockBody:
119+
Enabled: false
120+
121+
# In a regular class definition, no empty lines around the body.
122+
Layout/EmptyLinesAroundClassBody:
123+
Enabled: false
124+
125+
# In a regular method definition, no empty lines around the body.
126+
Layout/EmptyLinesAroundMethodBody:
127+
Enabled: false
128+
129+
# In a regular module definition, no empty lines around the body.
130+
Layout/EmptyLinesAroundModuleBody:
131+
Enabled: false
132+
133+
# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
134+
Style/HashSyntax:
135+
Enabled: false
136+
137+
Layout/LeadingCommentSpace:
138+
Enabled: false
139+
140+
Layout/SpaceAfterColon:
141+
Enabled: false
142+
143+
Layout/SpaceAfterComma:
144+
Enabled: false
145+
146+
Layout/SpaceAfterSemicolon:
147+
Enabled: false
148+
149+
Layout/SpaceAroundEqualsInParameterDefault:
150+
Enabled: false
151+
152+
Layout/SpaceAroundKeyword:
153+
Enabled: false
154+
155+
Layout/SpaceAroundOperators:
156+
Enabled: false
157+
158+
Layout/SpaceBeforeComma:
159+
Enabled: false
160+
161+
Layout/SpaceBeforeComment:
162+
Enabled: false
163+
164+
Layout/SpaceBeforeFirstArg:
165+
Enabled: false
166+
167+
Style/DefWithParentheses:
168+
Enabled: false
169+
170+
# Defining a method with parameters needs parentheses.
171+
Style/MethodDefParentheses:
172+
Enabled: false
173+
174+
Style/ExplicitBlockArgument:
175+
Enabled: false
176+
177+
Style/FrozenStringLiteralComment:
178+
Enabled: false
179+
180+
Style/MapToHash:
181+
Enabled: false
182+
183+
Style/RedundantFreeze:
184+
Enabled: false
185+
186+
# Use `foo {}` not `foo{}`.
187+
Layout/SpaceBeforeBlockBraces:
188+
Enabled: false
189+
190+
# Use `foo { bar }` not `foo {bar}`.
191+
Layout/SpaceInsideBlockBraces:
192+
Enabled: false
193+
EnforcedStyleForEmptyBraces: space
194+
195+
# Use `{ a: 1 }` not `{a:1}`.
196+
Layout/SpaceInsideHashLiteralBraces:
197+
Enabled: false
198+
199+
Layout/SpaceInsideParens:
200+
Enabled: false
201+
202+
# Use quotes for string literals when they are enough.
203+
Style/RedundantPercentQ:
204+
Enabled: false
205+
206+
Lint/AmbiguousOperator:
207+
Enabled: false
208+
209+
Lint/AmbiguousRegexpLiteral:
210+
Enabled: false
211+
212+
Lint/Debugger:
213+
Enabled: true
214+
215+
Lint/DuplicateRequire:
216+
Enabled: false
217+
218+
Lint/DuplicateMagicComment:
219+
Enabled: false
220+
221+
Lint/DuplicateMethods:
222+
Enabled: false
223+
224+
Lint/ErbNewArguments:
225+
Enabled: false
226+
227+
Lint/EnsureReturn:
228+
Enabled: false
229+
230+
# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
231+
Lint/RequireParentheses:
232+
Enabled: false
233+
234+
Lint/RedundantStringCoercion:
235+
Enabled: false
236+
237+
Lint/UriEscapeUnescape:
238+
Enabled: false
239+
240+
Lint/UselessAssignment:
241+
Enabled: false
242+
243+
Lint/DeprecatedClassMethods:
244+
Enabled: false
245+
246+
Style/EvalWithLocation:
247+
Enabled: false
248+
Exclude:
249+
- '**/test/**/*'
250+
251+
Style/ParenthesesAroundCondition:
252+
Enabled: false
253+
254+
Style/HashTransformKeys:
255+
Enabled: false
256+
257+
Style/HashTransformValues:
258+
Enabled: false
259+
260+
Style/RedundantBegin:
261+
Enabled: false
262+
263+
Style/RedundantReturn:
264+
Enabled: false
265+
AllowMultipleReturnValues: true
266+
267+
Style/RedundantRegexpEscape:
268+
Enabled: false
269+
270+
Style/Semicolon:
271+
Enabled: false
272+
AllowAsExpressionSeparator: true
273+
274+
Style/TrivialAccessors:
275+
Enabled: false
276+
277+
# Prefer a = b || c over a = b ? b : c
278+
Style/RedundantCondition:
279+
Enabled: false
280+
281+
Performance/BindCall:
282+
Enabled: false
283+
284+
Performance/FlatMap:
285+
Enabled: false
286+
287+
Performance/MapCompact:
288+
Enabled: false
289+
290+
Performance/SelectMap:
291+
Enabled: false
292+
293+
Performance/RedundantMerge:
294+
Enabled: false
295+
296+
Performance/StartWith:
297+
Enabled: false
298+
299+
Performance/EndWith:
300+
Enabled: false
301+
302+
Performance/RegexpMatch:
303+
Enabled: false
304+
305+
Performance/ReverseEach:
306+
Enabled: false
307+
308+
Performance/StringReplacement:
309+
Enabled: false
310+
311+
Performance/UnfreezeString:
312+
Enabled: false
313+
314+
Performance/DeletePrefix:
315+
Enabled: false
316+
317+
Performance/DeleteSuffix:
318+
Enabled: false
319+
320+
Performance/OpenStruct:
321+
Enabled: false
322+
323+
Performance/InefficientHashSearch:
324+
Enabled: false
325+
326+
Performance/ConstantRegexp:
327+
Enabled: false
328+
329+
Performance/RedundantStringChars:
330+
Enabled: false
331+
332+
Performance/StringInclude:
333+
Enabled: false
334+
335+
Minitest/AssertRaisesWithRegexpArgument:
336+
Enabled: false
337+
338+
Minitest/AssertWithExpectedArgument:
339+
Enabled: false
340+
341+
Minitest/SkipEnsure:
342+
Enabled: false
343+
344+
Minitest/UnreachableAssertion:
345+
Enabled: false
346+
347+
# Check quotes usage according to lint rule below.
348+
Style/StringLiterals:
349+
Enabled: false
350+
351+
# Files should always have a new line at the end
352+
Layout/TrailingEmptyLines:
353+
Enabled: false

.github/workflows/rubyonrails.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,4 @@ jobs:
8888
# run: bin/brakeman -q -w2
8989

9090
- name: Lint Ruby files
91-
run: bundle exec standardrb
91+
run: bin/rubocop

app/controllers/assistants_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
class AssistantsController < ApplicationController
22
skip_before_action :authenticate_user!
3-
before_action :set_assistant, only: %i[show edit update destroy]
3+
before_action :set_assistant, only: [:show, :edit, :update, :destroy]
44

55
def index
66
@assistants = Assistant.all

app/controllers/conversations_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
class ConversationsController < ApplicationController
22
skip_before_action :authenticate_user!
3-
before_action :set_conversation, only: %i[show edit update destroy]
3+
before_action :set_conversation, only: [:show, :edit, :update, :destroy]
44

55
def index
66
@conversations = Conversation.all

app/controllers/documents_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
class DocumentsController < ApplicationController
22
skip_before_action :authenticate_user!
3-
before_action :set_document, only: %i[show edit update destroy]
3+
before_action :set_document, only: [:show, :edit, :update, :destroy]
44

55
def index
66
@documents = Document.all

app/controllers/messages_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
class MessagesController < ApplicationController
22
skip_before_action :authenticate_user!
3-
before_action :set_message, only: %i[show edit update destroy]
3+
before_action :set_message, only: [:show, :edit, :update, :destroy]
44

55
def index
66
@messages = Message.all

0 commit comments

Comments
 (0)