spellcheck-github-actions: Ignoring paths is not supported in source_files
I’m having issues with configuring spellcheck to ignore file paths when passed in via the source_files argument
From the documentation here and in PySpelling, it looks like this should be all that’s required.
sources:
- '**/*.md*|!docs/api/**'`
This is how the action is invoked
jobs:
spellcheck:
name: Spellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.0
name: Checkout
- id: changed_files
name: Changed Files
uses: tj-actions/changed-files@v45
with:
files: |
**.mdx
- name: List all changed files
env:
ALL_CHANGED_FILES: ${{ steps.changed_files.outputs.all_changed_files }}
run: |
for file in ${ALL_CHANGED_FILES}; do
echo "$file was changed"
done
- uses: rojopolis/spellcheck-github-actions@0.41.0
name: Spellcheck
if: ${{ steps.changed_files.outputs.all_changed_files }}
with:
config_path: spellcheck.yaml
source_files: ${{ steps.changed_files.outputs.all_changed_files }}
task_name: Markdown
I suspect this is working as intended, wanted to confirm. I think I’ll need to filter out the changed files in the github action
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 17
Commits related to this issue
- Adopted use of pwc.py and cleaned up in processing to handle this new use case, see #213 — committed to rojopolis/spellcheck-github-actions by jonasbn 2 years ago
Branch that explores git handling in PySpelling https://github.com/facelessuser/pyspelling/pull/193/files. Things are subject to change and the addition of such functionality is not guaranteed but only being explored at the present.
Okay, in that case, you would need to pass in exclude patterns with
!exclude. Currently, that requires you to specify them via--source "!exlude|include"as each--sourceis evaluated independently. If it makes it easier, the change I mentioned earlier would allow you to pass them in separately as all the patterns would be evaluated simultaneously. So--source include1 --source include2 --source !excludewould work.Let me know if that helps, if not you can join exclude and include with
|.It is a public repo, here’s the spellcheck.yaml file. I ended up adding the filter to the changed file detection workflow step, since I think this action is basically connecting to the PySpelling CLI and passing in the files there.
Overall I think I need to revise my approach to spellcheck the built HTML files since
mdxfiles aren’t well handled by PySpelling.