Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ignoring files #176

Closed
martincostello opened this issue Oct 5, 2023 · 3 comments
Closed

Support ignoring files #176

martincostello opened this issue Oct 5, 2023 · 3 comments
Assignees
Labels
support Support not requiring code changes

Comments

@martincostello
Copy link

From looking at the documentation, it looks like you can specify files to check, but you can't specify files to exclude.

I have dozens of files I do want to check, but only a handful I want to ignore.

With DavidAnson/markdownlint-cli2-action for example, I can specify some globs:

- name: Lint Markdown files
  uses: DavidAnson/markdownlint-cli2-action@v13
  with:
    globs: |
      **/*.md
      !CHANGELOG.md
      !**/BenchmarkDotNet.Artifacts/**/*.md

It would be nice if similar functionality were supported so I don't need to list every file individually in the case I want to only ignore one or more files.

@jonasbn
Copy link
Collaborator

jonasbn commented Oct 5, 2023

Hi @martincostello

The action is just a utility for PySpelling, so you could look into it's configuration, especially the part on sources.

I am doing some basic ignoring in one of my own repositories.

matrix:
- name: Markdown
  aspell:
    lang: en
  dictionary:
    wordlists:
    - .wordlist.txt
    encoding: utf-8
  pipeline:
  - pyspelling.filters.markdown:
      markdown_extensions:
      - pymdownx.superfences:
  - pyspelling.filters.html:
      comments: false
      ignores:
      - code
      - pre
  sources:
  - '!_site/*.md|!osx/list_available_voices_for_speechsynthesis.md|!clang/diagnostic_flags.md|*/*.md|README.md'
  default_encoding: utf-8

REF: https://github.com/jonasbn/til/blob/master/.spellcheck.yaml

I am no wizard on PySpelling and: wcmatch.glob which is the component used, perhaps it can help you out.

I will leave this issue open and will await you feedback.

@jonasbn jonasbn self-assigned this Oct 5, 2023
@jonasbn jonasbn added the support Support not requiring code changes label Oct 5, 2023
@martincostello
Copy link
Author

Thanks @jonasbn.

I did try a few ways of trying to ignore stuff, but they didn't seem to work. Putting all the globs on one line with pipes between seems to do the trick though, so that's my immediate requirement solved.

Maybe it's worth adding an example to your README illustrating how to do ignores?

@jonasbn
Copy link
Collaborator

jonasbn commented Oct 6, 2023

Hi @martincostello

I will update the documentation with an example - thanks

@jonasbn jonasbn closed this as completed Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support Support not requiring code changes
Projects
None yet
Development

No branches or pull requests

2 participants