Skip to content

Commit 53b1156

Browse files
chore(internal): run rubocop linter in parallel (#123)
1 parent 9817037 commit 53b1156

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

.rubocop.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Layout/LineLength:
3939
AllowedPatterns:
4040
- "^\\s*#.*$"
4141
- ^require(_relative)?
42-
- "FinchAPI::(Models|Resources)::"
42+
- "FinchAPI::(Models|Resources|Test)::"
4343
Max: 110
4444

4545
Layout/MultilineArrayLineBreaks:
@@ -122,9 +122,9 @@ Metrics/PerceivedComplexity:
122122
Naming/BlockForwarding:
123123
Enabled: false
124124

125+
# Underscores are generally useful for disambiguation.
125126
Naming/ClassAndModuleCamelCase:
126-
Exclude:
127-
- "**/*.rbi"
127+
Enabled: false
128128

129129
Naming/MethodParameterName:
130130
Enabled: false

Rakefile

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ require "rubocop/rake_task"
99

1010
CLEAN.push(*%w[.idea/ .ruby-lsp/ .yardoc/])
1111

12-
xargs = %w[xargs --no-run-if-empty --null --max-procs=0 --max-args=300 --]
13-
1412
multitask(default: [:test])
1513

1614
multitask(:test) do
@@ -22,17 +20,17 @@ multitask(:test) do
2220
ruby(*%w[-w -e], rb, verbose: false) { fail unless _1 }
2321
end
2422

25-
RuboCop::RakeTask.new(:rubocop) do |t|
26-
t.options = %w[--fail-level E]
27-
if ENV.key?("CI")
28-
t.options += %w[--format github]
29-
end
23+
rubo_find = %w[find ./lib ./test ./rbi -type f -and ( -name *.rb -or -name *.rbi ) -print0]
24+
xargs = %w[xargs --no-run-if-empty --null --max-procs=0 --max-args=300 --]
25+
26+
multitask(:rubocop) do
27+
lint = xargs + %w[rubocop --fail-level E] + (ENV.key?("CI") ? %w[--format github] : [])
28+
sh("#{rubo_find.shelljoin} | #{lint.shelljoin}")
3029
end
3130

3231
multitask(:ruboformat) do
33-
find = %w[find ./lib ./test ./rbi -type f -and ( -name *.rb -or -name *.rbi ) -print0]
3432
fmt = xargs + %w[rubocop --fail-level F --autocorrect --format simple --]
35-
sh("#{find.shelljoin} | #{fmt.shelljoin}")
33+
sh("#{rubo_find.shelljoin} | #{fmt.shelljoin}")
3634
end
3735

3836
multitask(:syntax_tree) do

0 commit comments

Comments
 (0)