Skip to content

excludes are relative to current directory, not typos.toml location #593

Description

@embe-pw

When $DIR/typos.toml contains

[files]
extend-exclude = ["a/*.txt"]

and we run typos in $DIR, the file a/test.txt is correctly excluded. But when typos is run in $DIR/a, the exclude is not respected:

$ cat typos.toml
[files]
extend-exclude = ["a/*.txt"]
$ typos
$ (cd a; typos)
error: `tpyo` should be `typo`
  --> ./test.txt:1:1
  |
1 | tpyo
  | ^^^^
  |

When typos.toml excludes *.txt both cases work, so the issue is not caused by ignoring the configuration in the parent directory:

$ cat typos.toml
[files]
extend-exclude = ["*.txt"]
$ typos
$ (cd a; typos)

It would make sense to interpret the excludes relative to the typos.toml location.

(tested with typos 1.12.8 binary from the GitHub release)

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions