Skip to content

Commit 7c93cec

Browse files
authored
Merge pull request #293 from jcraigk/rubocop
Rubocop auto-correct and comprehensive todo
2 parents 5ecfbf4 + 9ef8c13 commit 7c93cec

File tree

232 files changed

+1407
-291
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

232 files changed

+1407
-291
lines changed

.rubocop.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
1+
inherit_from: .rubocop_todo.yml
2+
3+
require:
4+
- rubocop-performance
5+
- rubocop-rspec
6+
17
AllCops:
8+
DisplayCopNames: true
29
Exclude:
10+
- bin/**/*
311
- vendor/**/*
412
- lib/slack/web/api/slack-api-ref/**/*
5-
6-
Metrics:
13+
- lib/slack/web/api/endpoints/* # Auto-generated
14+
- spec/slack/web/api/endpoints/* # Auto-generated
15+
Layout/EmptyLineAfterMagicComment:
716
Enabled: false
8-
17+
Metrics/BlockLength:
18+
Max: 250
19+
Metrics/ClassLength:
20+
Max: 250
921
Metrics/LineLength:
10-
Max: 512
11-
22+
Max: 100
1223
Style/Documentation:
1324
Enabled: false
14-
15-
Naming/MethodName:
16-
Enabled: false
17-
18-
Style/ModuleFunction:
19-
Enabled: false
20-
21-
inherit_from: .rubocop_todo.yml

.rubocop_todo.yml

Lines changed: 298 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This configuration was generated by
2-
# `rubocop --auto-gen-config`
3-
# on 2019-07-21 18:39:19 -0400 using RuboCop version 0.61.1.
2+
# `rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 100`
3+
# on 2019-08-01 15:06:19 -0700 using RuboCop version 0.73.0.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
@@ -14,22 +14,61 @@ Lint/AssignmentInCondition:
1414
- 'lib/slack/real_time/socket.rb'
1515

1616
# Offense count: 5
17+
# Configuration parameters: AllowComments.
1718
Lint/HandleExceptions:
1819
Exclude:
1920
- 'lib/slack-ruby-client.rb'
2021
- 'lib/slack/real_time/concurrency/async.rb'
2122
- 'spec/slack/real_time/concurrency/celluloid_spec.rb'
2223
- 'spec/slack/real_time/concurrency/eventmachine_spec.rb'
2324

24-
# Offense count: 4
25+
# Offense count: 9
26+
# Configuration parameters: Max.
27+
Metrics/AbcSize:
28+
Exclude:
29+
- 'lib/slack/real_time/client.rb'
30+
- 'lib/slack/real_time/concurrency/async.rb'
31+
- 'lib/slack/real_time/stores/store.rb'
32+
- 'lib/slack/web/api/mixins/users.search.rb'
33+
- 'lib/slack/web/faraday/connection.rb'
34+
- 'lib/slack/web/pagination/cursor.rb'
35+
- 'spec/integration/integration_spec.rb'
36+
37+
# Offense count: 1
38+
# Configuration parameters: Max.
39+
Metrics/CyclomaticComplexity:
40+
Exclude:
41+
- 'lib/slack/web/faraday/connection.rb'
42+
43+
# Offense count: 13
44+
# Configuration parameters: CountComments, Max, ExcludedMethods.
45+
Metrics/MethodLength:
46+
Exclude:
47+
- 'lib/slack/messages/formatting.rb'
48+
- 'lib/slack/real_time/client.rb'
49+
- 'lib/slack/real_time/concurrency/async.rb'
50+
- 'lib/slack/real_time/concurrency/celluloid.rb'
51+
- 'lib/slack/real_time/config.rb'
52+
- 'lib/slack/real_time/stores/store.rb'
53+
- 'lib/slack/web/api/mixins/users.search.rb'
54+
- 'lib/slack/web/config.rb'
55+
- 'lib/slack/web/faraday/connection.rb'
56+
- 'lib/slack/web/faraday/request.rb'
57+
- 'lib/slack/web/pagination/cursor.rb'
58+
- 'spec/integration/integration_spec.rb'
59+
60+
# Offense count: 1
61+
# Configuration parameters: Max.
62+
Metrics/PerceivedComplexity:
63+
Exclude:
64+
- 'lib/slack/web/faraday/connection.rb'
65+
66+
# Offense count: 1
2567
# Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts, AllowedAcronyms.
2668
# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
2769
Naming/FileName:
2870
Exclude:
29-
- 'bin/commands/chat_scheduledMessages.rb'
3071
- 'lib/slack-ruby-client.rb'
31-
- 'lib/slack/web/api/endpoints/chat_scheduledMessages.rb'
32-
- 'spec/slack/web/api/endpoints/chat_scheduledMessages_spec.rb'
3372

3473
# Offense count: 1
3574
# Configuration parameters: EnforcedStyleForLeadingUnderscores.
@@ -38,6 +77,229 @@ Naming/MemoizedInstanceVariableName:
3877
Exclude:
3978
- 'lib/slack/logger.rb'
4079

80+
# Offense count: 1
81+
RSpec/AnyInstance:
82+
Exclude:
83+
- 'spec/slack/real_time/concurrency/celluloid_spec.rb'
84+
85+
# Offense count: 69
86+
# Configuration parameters: Prefixes.
87+
# Prefixes: when, with, without
88+
RSpec/ContextWording:
89+
Exclude:
90+
- 'spec/integration/integration_spec.rb'
91+
- 'spec/slack/events/config_spec.rb'
92+
- 'spec/slack/events/request_spec.rb'
93+
- 'spec/slack/messages/formatting_spec.rb'
94+
- 'spec/slack/real_time/client_spec.rb'
95+
- 'spec/slack/real_time/concurrency/celluloid_spec.rb'
96+
- 'spec/slack/real_time/event_handlers/bot_spec.rb'
97+
- 'spec/slack/real_time/event_handlers/channel_spec.rb'
98+
- 'spec/slack/real_time/event_handlers/group_spec.rb'
99+
- 'spec/slack/real_time/event_handlers/im_spec.rb'
100+
- 'spec/slack/real_time/event_handlers/team_spec.rb'
101+
- 'spec/slack/real_time/event_handlers/user_spec.rb'
102+
- 'spec/slack/slack_spec.rb'
103+
- 'spec/slack/web/api/endpoints/custom_specs/auth_spec.rb'
104+
- 'spec/slack/web/api/endpoints/custom_specs/channels_spec.rb'
105+
- 'spec/slack/web/api/endpoints/custom_specs/chat_spec.rb'
106+
- 'spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb'
107+
- 'spec/slack/web/api/endpoints/custom_specs/groups_spec.rb'
108+
- 'spec/slack/web/api/endpoints/custom_specs/users_spec.rb'
109+
- 'spec/slack/web/api/mixins/channels_spec.rb'
110+
- 'spec/slack/web/api/mixins/groups_spec.rb'
111+
- 'spec/slack/web/api/mixins/users_spec.rb'
112+
- 'spec/slack/web/api/pagination/cursor_spec.rb'
113+
- 'spec/slack/web/client_spec.rb'
114+
- 'spec/support/real_time/connected_client.rb'
115+
116+
# Offense count: 1
117+
RSpec/DescribeClass:
118+
Exclude:
119+
- 'spec/integration/integration_spec.rb'
120+
121+
# Offense count: 5
122+
# Cop supports --auto-correct.
123+
RSpec/EmptyLineAfterExampleGroup:
124+
Exclude:
125+
- 'spec/slack/web/api/endpoints/custom_specs/auth_spec.rb'
126+
- 'spec/slack/web/api/endpoints/custom_specs/chat_spec.rb'
127+
128+
# Offense count: 8
129+
# Cop supports --auto-correct.
130+
RSpec/EmptyLineAfterFinalLet:
131+
Exclude:
132+
- 'spec/slack/web/api/endpoints/custom_specs/auth_spec.rb'
133+
- 'spec/slack/web/api/endpoints/custom_specs/channels_spec.rb'
134+
- 'spec/slack/web/api/endpoints/custom_specs/chat_spec.rb'
135+
- 'spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb'
136+
- 'spec/slack/web/api/endpoints/custom_specs/groups_spec.rb'
137+
- 'spec/slack/web/api/endpoints/custom_specs/users_spec.rb'
138+
139+
# Offense count: 63
140+
# Configuration parameters: Max.
141+
RSpec/ExampleLength:
142+
Exclude:
143+
- 'spec/integration/integration_spec.rb'
144+
- 'spec/slack/real_time/client_spec.rb'
145+
- 'spec/slack/real_time/event_handlers/bot_spec.rb'
146+
- 'spec/slack/real_time/event_handlers/channel_spec.rb'
147+
- 'spec/slack/real_time/event_handlers/event_handlers_spec.rb'
148+
- 'spec/slack/real_time/event_handlers/group_spec.rb'
149+
- 'spec/slack/real_time/event_handlers/im_spec.rb'
150+
- 'spec/slack/real_time/event_handlers/team_spec.rb'
151+
- 'spec/slack/real_time/event_handlers/user_spec.rb'
152+
- 'spec/slack/slack_spec.rb'
153+
- 'spec/slack/web/api/endpoints/custom_specs/auth_spec.rb'
154+
- 'spec/slack/web/api/endpoints/custom_specs/chat_spec.rb'
155+
- 'spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb'
156+
- 'spec/slack/web/api/endpoints/custom_specs/users_spec.rb'
157+
- 'spec/slack/web/api/error_spec.rb'
158+
- 'spec/slack/web/api/errors/service_unavailable_spec.rb'
159+
- 'spec/slack/web/api/errors/slack_error_spec.rb'
160+
- 'spec/slack/web/api/pagination/cursor_spec.rb'
161+
- 'spec/slack/web/client_spec.rb'
162+
- 'spec/slack/web/faraday/response/raise_error_spec.rb'
163+
164+
# Offense count: 2
165+
RSpec/ExpectInHook:
166+
Exclude:
167+
- 'spec/slack/real_time/client_spec.rb'
168+
169+
# Offense count: 16
170+
# Configuration parameters: CustomTransform, IgnoreMethods.
171+
RSpec/FilePath:
172+
Exclude:
173+
- 'spec/slack/real_time/api/message_spec.rb'
174+
- 'spec/slack/real_time/api/ping_spec.rb'
175+
- 'spec/slack/real_time/api/typing_spec.rb'
176+
- 'spec/slack/real_time/event_handlers/bot_spec.rb'
177+
- 'spec/slack/real_time/event_handlers/channel_spec.rb'
178+
- 'spec/slack/real_time/event_handlers/event_handlers_spec.rb'
179+
- 'spec/slack/real_time/event_handlers/group_spec.rb'
180+
- 'spec/slack/real_time/event_handlers/im_spec.rb'
181+
- 'spec/slack/real_time/event_handlers/user_spec.rb'
182+
- 'spec/slack/web/api/endpoints/custom_specs/auth_spec.rb'
183+
- 'spec/slack/web/api/endpoints/custom_specs/channels_spec.rb'
184+
- 'spec/slack/web/api/endpoints/custom_specs/chat_spec.rb'
185+
- 'spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb'
186+
- 'spec/slack/web/api/endpoints/custom_specs/groups_spec.rb'
187+
- 'spec/slack/web/api/endpoints/custom_specs/users_spec.rb'
188+
- 'spec/slack/web/api/errors/service_unavailable_spec.rb'
189+
190+
# Offense count: 1
191+
# Cop supports --auto-correct.
192+
# Configuration parameters: EnforcedStyle.
193+
# SupportedStyles: implicit, each, example
194+
RSpec/HookArgument:
195+
Exclude:
196+
- 'spec/slack/web/api/endpoints/custom_specs/chat_spec.rb'
197+
198+
# Offense count: 13
199+
# Configuration parameters: AssignmentOnly.
200+
RSpec/InstanceVariable:
201+
Exclude:
202+
- 'spec/integration/integration_spec.rb'
203+
- 'spec/slack/real_time/client_spec.rb'
204+
- 'spec/slack/slack_spec.rb'
205+
206+
# Offense count: 68
207+
# Configuration parameters: .
208+
# SupportedStyles: have_received, receive
209+
RSpec/MessageSpies:
210+
EnforcedStyle: receive
211+
212+
# Offense count: 92
213+
# Configuration parameters: Max, AggregateFailuresByDefault.
214+
RSpec/MultipleExpectations:
215+
Exclude:
216+
- 'spec/integration/integration_spec.rb'
217+
- 'spec/slack/events/config_spec.rb'
218+
- 'spec/slack/events/request_spec.rb'
219+
- 'spec/slack/real_time/client_spec.rb'
220+
- 'spec/slack/real_time/concurrency/celluloid_spec.rb'
221+
- 'spec/slack/real_time/concurrency/eventmachine_spec.rb'
222+
- 'spec/slack/real_time/event_handlers/bot_spec.rb'
223+
- 'spec/slack/real_time/event_handlers/channel_spec.rb'
224+
- 'spec/slack/real_time/event_handlers/event_handlers_spec.rb'
225+
- 'spec/slack/real_time/event_handlers/group_spec.rb'
226+
- 'spec/slack/real_time/event_handlers/im_spec.rb'
227+
- 'spec/slack/real_time/event_handlers/team_spec.rb'
228+
- 'spec/slack/real_time/event_handlers/user_spec.rb'
229+
- 'spec/slack/real_time/store_spec.rb'
230+
- 'spec/slack/slack_spec.rb'
231+
- 'spec/slack/web/api/endpoints/custom_specs/auth_spec.rb'
232+
- 'spec/slack/web/api/endpoints/custom_specs/chat_spec.rb'
233+
- 'spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb'
234+
- 'spec/slack/web/api/endpoints/custom_specs/users_spec.rb'
235+
- 'spec/slack/web/api/error_spec.rb'
236+
- 'spec/slack/web/api/errors/service_unavailable_spec.rb'
237+
- 'spec/slack/web/api/errors/slack_error_spec.rb'
238+
- 'spec/slack/web/api/pagination/cursor_spec.rb'
239+
- 'spec/slack/web/client_spec.rb'
240+
241+
# Offense count: 53
242+
# Configuration parameters: IgnoreSharedExamples.
243+
RSpec/NamedSubject:
244+
Exclude:
245+
- 'spec/slack/events/request_spec.rb'
246+
- 'spec/slack/messages/formatting_spec.rb'
247+
- 'spec/slack/web/api/mixins/channels_spec.rb'
248+
- 'spec/slack/web/api/mixins/groups_spec.rb'
249+
- 'spec/slack/web/api/mixins/users_spec.rb'
250+
- 'spec/slack/web/faraday/response/raise_error_spec.rb'
251+
252+
# Offense count: 32
253+
# Configuration parameters: Max.
254+
RSpec/NestedGroups:
255+
Exclude:
256+
- 'spec/slack/real_time/client_spec.rb'
257+
- 'spec/slack/web/api/pagination/cursor_spec.rb'
258+
- 'spec/slack/web/client_spec.rb'
259+
260+
# Offense count: 15
261+
# Cop supports --auto-correct.
262+
# Configuration parameters: EnforcedStyle.
263+
# SupportedStyles: not_to, to_not
264+
RSpec/NotToNot:
265+
Exclude:
266+
- 'spec/slack/web/api/endpoints/custom_specs/auth_spec.rb'
267+
- 'spec/slack/web/api/endpoints/custom_specs/chat_spec.rb'
268+
- 'spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb'
269+
270+
# Offense count: 2
271+
RSpec/RepeatedDescription:
272+
Exclude:
273+
- 'spec/slack/web/api/endpoints/custom_specs/users_spec.rb'
274+
275+
# Offense count: 2
276+
RSpec/ScatteredLet:
277+
Exclude:
278+
- 'spec/integration/integration_spec.rb'
279+
280+
# Offense count: 4
281+
RSpec/ScatteredSetup:
282+
Exclude:
283+
- 'spec/integration/integration_spec.rb'
284+
285+
# Offense count: 3
286+
RSpec/SubjectStub:
287+
Exclude:
288+
- 'spec/slack/web/api/mixins/channels_spec.rb'
289+
- 'spec/slack/web/api/mixins/groups_spec.rb'
290+
- 'spec/slack/web/api/mixins/users_spec.rb'
291+
292+
# Offense count: 16
293+
# Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
294+
RSpec/VerifiedDoubles:
295+
Exclude:
296+
- 'spec/slack/events/request_spec.rb'
297+
- 'spec/slack/real_time/client_spec.rb'
298+
- 'spec/slack/real_time/concurrency/celluloid_spec.rb'
299+
- 'spec/slack/real_time/concurrency/eventmachine_spec.rb'
300+
- 'spec/slack/web/faraday/response/raise_error_spec.rb'
301+
- 'spec/support/real_time/connected_client.rb'
302+
41303
# Offense count: 1
42304
Security/Open:
43305
Exclude:
@@ -51,25 +313,46 @@ Style/AccessModifierDeclarations:
51313
- 'lib/slack/real_time/concurrency/eventmachine.rb'
52314
- 'lib/slack/real_time/socket.rb'
53315

54-
# Offense count: 155
55-
# Configuration parameters: AllowedVariables.
56-
Style/GlobalVars:
57-
Enabled: false
316+
# Offense count: 6
317+
# Cop supports --auto-correct.
318+
# Configuration parameters: EnforcedStyle.
319+
# SupportedStyles: always, never
320+
Style/FrozenStringLiteralComment:
321+
Exclude:
322+
- 'spec/slack/web/api/endpoints/custom_specs/auth_spec.rb'
323+
- 'spec/slack/web/api/endpoints/custom_specs/channels_spec.rb'
324+
- 'spec/slack/web/api/endpoints/custom_specs/chat_spec.rb'
325+
- 'spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb'
326+
- 'spec/slack/web/api/endpoints/custom_specs/groups_spec.rb'
327+
- 'spec/slack/web/api/endpoints/custom_specs/users_spec.rb'
58328

59-
# Offense count: 3
329+
# Offense count: 2
60330
# Configuration parameters: MinBodyLength.
61331
Style/GuardClause:
62332
Exclude:
63333
- 'lib/slack/real_time/socket.rb'
64-
- 'lib/slack/real_time/stores/store.rb'
65334
- 'lib/slack/web/faraday/response/raise_error.rb'
66335

67-
# Offense count: 1
68-
Style/MixinUsage:
336+
# Offense count: 3
337+
# Cop supports --auto-correct.
338+
# Configuration parameters: EnforcedStyle, Autocorrect.
339+
# SupportedStyles: module_function, extend_self
340+
Style/ModuleFunction:
69341
Exclude:
70-
- 'bin/slack'
342+
- 'lib/slack/config.rb'
343+
- 'lib/slack/events/config.rb'
344+
- 'lib/slack/web/config.rb'
71345

72346
# Offense count: 1
73347
Style/MultilineTernaryOperator:
74348
Exclude:
75349
- 'spec/support/real_time/connected_client.rb'
350+
351+
# Offense count: 1
352+
# Cop supports --auto-correct.
353+
# Configuration parameters: AutoCorrect, EnforcedStyle, IgnoredMethods.
354+
# SupportedStyles: predicate, comparison
355+
Style/NumericPredicate:
356+
Exclude:
357+
- 'spec/**/*'
358+
- 'lib/slack/real_time/client.rb'

0 commit comments

Comments
 (0)