curl/.github/workflows/spellcheck.yml
Daniel Stenberg 72c41f7c8b
GHA: spellcheck
This spellchecker checks markdown files. For this reason this job
converts all man pages in the repository to markdown with pandoc before
the check runs.

The perl script 'cleanspell' filters out details from the man page in
the process, to avoid the spellchecker trying to spellcheck things it
can't. Like curl specific symbols and the SYNOPSIS and EXAMPLE sections
of libcurl man pages.

The spell checker does not check words in sections that are within pre,
strong and em tags.

'spellcheck.words' is a custom word list with additional accepted words.

Closes #9523
2022-09-21 15:20:07 +02:00

51 lines
1.2 KiB
YAML

# Copyright (C) 2022 Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
name: spell
on:
push:
branches:
- master
paths:
- '**.md'
- '**.3'
- '**.1'
- '.github/**'
pull_request:
branches:
- master
paths:
- '**.md'
- '**.3'
- '**.1'
- '.github/**'
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: install pandoc
run: sudo apt-get install pandoc
- name: strip "uncheckable" sections from .3 pages
run: find docs -name "*.3" -size +40c | sed 's/\.3//' | xargs -t -n1 -I OO ./.github/scripts/cleanspell.pl OO.3 OO.33
- name: convert .3 man pages to markdown
run: find docs -name "*.33" -size +40c | sed 's/\.33//' | xargs -t -n1 -I OO pandoc -f man -t markdown OO.33 -o OO.md
- name: convert .1 man pages to markdown
run: find docs -name "*.1" -size +40c | sed 's/\.1//' | xargs -t -n1 -I OO pandoc OO.1 -o OO.md
- name: setup the custom wordlist
run: grep -v '^#' .github/scripts/spellcheck.words > wordlist.txt
- name: setup the spellcheck config
run: cp .github/scripts/spellcheck.yaml .
- name: Check Spelling
uses: UnicornGlobal/spellcheck-github-actions@master