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

Always ignore template at top level pre-commit #320

Merged
merged 1 commit into from
Mar 21, 2024

Conversation

paddyroddy
Copy link
Member

@paddyroddy paddyroddy commented Mar 20, 2024

We lint at the top level, and at the template level. It doesn't really make sense to template both, and some of the hooks get confused with the cookiecutter templating. Previously, we were ignoring some, but actually makes sense to ignore it all.

The downside is that locally it will be annoying to lint at the package level. But that is fine because CI with lint at the template level. Sometimes you may need to create a dummy project to fix the issue.

@paddyroddy paddyroddy added the enhancement New feature or request label Mar 20, 2024
@paddyroddy paddyroddy self-assigned this Mar 20, 2024
Copy link
Member

@dstansby dstansby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I understand, on one of the CI runs we still template a new package and run pre-commit on that new package? If so I think this is a nice simplification 👍

Copy link
Collaborator

@matt-graham matt-graham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From experience in working on both #318 and #319 the occasional bad interactions between templating syntax and what pre-commit hooks expect in the various files are a bit of pain so this seems a good idea to me.

Copy link
Member

@samcunliffe samcunliffe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, agreed.

@paddyroddy paddyroddy merged commit 508b5e7 into main Mar 21, 2024
15 checks passed
@paddyroddy paddyroddy deleted the simplify-pre-commit-exclude branch March 21, 2024 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants