Skip to content

fix: pre-commit hook file type filter#1477

Merged
Nytelife26 merged 1 commit intoamperser:mainfrom
cbachhuber:fix-pre-commit-types-filter
Jan 16, 2026
Merged

fix: pre-commit hook file type filter#1477
Nytelife26 merged 1 commit intoamperser:mainfrom
cbachhuber:fix-pre-commit-types-filter

Conversation

@cbachhuber
Copy link
Copy Markdown
Contributor

@cbachhuber cbachhuber commented Jan 14, 2026

Relevant issues

In #1465, I only did a manual test for the initial commit, but not for subsequent ones. This way, I broke the file filter and now, the hook doesn't apply to any file, but just skips all of them. For example for a markdown file:

image

Brief

Fix the pre-commit hook to apply to any of the listed file types.

Changes

same as brief. With this change, I get

image

So the hook applies to the correct files again.

Why did this break? Because of this logic:

types, types_or, and files are evaluated together with AND when filtering. Tags within types are also evaluated using AND.

So the hook tried to find files that are simultaneously markdown, html, txt, and tex. In contrast to this,

Tags within types_or are evaluated using OR.

So that's the field we want to set.

@Nytelife26 Nytelife26 requested a review from drainpixie January 16, 2026 12:51
@Nytelife26 Nytelife26 merged commit 36ed58e into amperser:main Jan 16, 2026
18 checks passed
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

Successfully merging this pull request may close these issues.

3 participants