Skip to content

Commit 7615a37

Browse files
authored
Merge pull request #513 from Earlopain/sync-spellchecking
Sync spellchecking from rubocop repo
2 parents c592668 + 2bfd0c6 commit 7615a37

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

.github/workflows/spell_checking.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,3 @@ jobs:
1515
- uses: codespell-project/actions-codespell@v2
1616
with:
1717
ignore_words_file: codespell.txt
18-
misspell:
19-
name: Check spelling of all files in commit with misspell
20-
runs-on: ubuntu-latest
21-
steps:
22-
- uses: actions/checkout@v5
23-
- name: Install
24-
run: wget -O - -q https://raw.githubusercontent.com/client9/misspell/master/install-misspell.sh | sh -s -- -b .
25-
- name: Misspell
26-
run: git ls-files --empty-directory | xargs ./misspell -error

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)