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

Guidance on extend-exclude for a directory? #861

Closed
erikspears opened this issue Oct 23, 2023 · 4 comments
Closed

Guidance on extend-exclude for a directory? #861

erikspears opened this issue Oct 23, 2023 · 4 comments

Comments

@erikspears
Copy link

Hi, I've been searching through and reading the Issues (and Readme, of course) around the extend-exclude option with typos, and I'm still hitting a speedbump. I'd like to implement typos in a GitHub Workflow Action, and after verifying that I've got it finding the config file correctly, I just can't seem to get it to exclude checking a specific directory in our repo. 🤦 Hoping some fresh eyes from someone here can point me to my goof. 🤞

Workflows Action file:

name: Testing spell check

# Only allow manual run of this workflow from the Actions tab
on:
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v4

    # Spell check job
    - name: Check Spelling
      uses: crate-ci/typos@master
      with:
        config: ./.github/workflows/typos.toml
        write_changes: true

And here's the typos.toml file; it lives in the same directory as the workflow file in the repo (.github/workflows):

# Exclude the following from spell checking workflow job

[files]
extend-exclude = ["./swirl/tests/"]

The directory I'd like to exclude from spell checking is called tests, and it has some subdirectories as well. I'd like to exlucde all of it. That dir lives, from the root of the repo, at ./swirl/tests

I've tried a variety of path syntax in the extend-exclude line...a couple examples:

  • ["./swirl/tests/*"]
  • ["../swirl/tests/"]

Pointer to the public repo, if that helps: https://github.com/swirlai/swirl-search

Any pointers or guidance much appreciated, thank you!

@epage
Copy link
Collaborator

epage commented Oct 23, 2023

I think its the ./ prefix. I removed that and it seems to work for me.

@erikspears
Copy link
Author

Hi @epage ,

Thanks so much for taking a look and the speedy response. That did the trick! 🙌

For my own understanding ... the config file paths for exclude (at least) seem to start naturatlly from the top of the repo, then?

Thanks again for the help!
--Erik

@epage
Copy link
Collaborator

epage commented Oct 23, 2023

Currently, they start from the CWD that typos is run from, see #593.

@erikspears
Copy link
Author

Nice, thanks for the pointer as well. This is great stuff!

Closing this Issues. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants