Skip to content

Commit 95b3559

Browse files
committed
Run codespell with bundle exec rake
* rubocop/rubocop#13743 * rubocop/rubocop#14203
1 parent c592668 commit 95b3559

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ end
4141
desc 'Run RuboCop over itself'
4242
RuboCop::RakeTask.new(:internal_investigation)
4343

44-
task default: %i[documentation_syntax_check spec prism_spec internal_investigation]
44+
task default: %i[codespell documentation_syntax_check spec prism_spec internal_investigation]
4545

4646
desc 'Generate a new cop template'
4747
task :new_cop, [:cop] do |_task, args|

tasks/codespell.rake

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# frozen_string_literal: true
2+
3+
desc 'Run codespell if available'
4+
task :codespell do |_task|
5+
next if Gem.win_platform?
6+
next if ENV['CI'] # CI has its own workflow for this
7+
8+
sh 'which codespell', verbose: false, out: File::NULL, err: File::NULL do |ok, _res|
9+
if ok
10+
sh 'git ls-files --empty-directory | xargs codespell'
11+
else
12+
puts 'Skipping `codespell` since it is not installed'
13+
end
14+
end
15+
end

0 commit comments

Comments
 (0)