mirror of
https://github.com/astral-sh/ruff
synced 2026-01-21 13:30:49 -05:00
## Summary Exclusions in Git pathspecs [are not order-sensitive](https://css-tricks.com/git-pathspecs-and-how-to-use-them/#aa-exclude): > After all other pathspecs have been resolved, all pathspecs with an exclude signature are resolved and then removed from the returned paths. This means that we can't write chains like we had here before to exclude Markdown file changes *unless* they are in `crates/ty_python_semantic/resources/mdtest`. This doesn't work. The exclude pattern will just overwrite the second pattern and all Markdown changes will be excluded: ```bash ':!**/*.md' \ ':crates/ty_python_semantic/resources/mdtest/**/*.md' \ ``` The configuration we had here before meant that tests wouldn't run on MD-test only PRs, see e.g. https://github.com/astral-sh/ruff/pull/19476. So here, I'm proposing to remove the broad `:!**/*.md` pattern. We can always add more fine-grained exclusion patterns, if that's needed. The `docs` folder is already excluded. ## Test Plan Tested with local `git diff` invocations.