Skip to content

Support ignoring files #176

Closed
Closed

Description

@martincostello

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.

Activity

  1. jonasbn commented on Oct 5, 2023

    @jonasbn
    Collaborator

    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.

  2. self-assigned this
    on Oct 5, 2023
  3. added
    support
    on Oct 5, 2023
  4. martincostello commented on Oct 6, 2023

    @martincostello
    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?

  5. jonasbn commented on Oct 6, 2023

    @jonasbn
    Collaborator

    Hi @martincostello

    I will update the documentation with an example - thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

support

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions