pre-commit-ci / issues

public issues for https://pre-commit.ci
16 stars 3 forks source link

Run pre-commit only on changes in the PR #90

Closed djhoese closed 2 years ago

djhoese commented 2 years ago

I'm using pre-commit on a project that has existed for a long time without any style/standards checking so there are a lot of issues. I plan on fixing them over time. Right now pre-commit/pre-commit.ci run against all files in the repository and not only the ones that changed in the pull request. Is it possible to allow this?

I see that something was possible in the old GitHub Action:

https://github.com/pre-commit/action/issues/7

asottile commented 2 years ago

changed-files-only may be a paid feature in the future but I have no plans to implement it right now

for what it's worth, I strongly recommend against incremental adoption of formatters / linters as it leads to noisy diffs and increases the number of times your contributors encounter merge conflicts. the best practice is to apply a tool all at once and get everything up to spec

djhoese commented 2 years ago

Makes sense. Thanks.

janosh commented 2 years ago

changed-files-only may be a paid feature in the future but I have no plans to implement it right now

Wouldn't this reduce your AWS bill? Seems odd to make it paid only.

asottile commented 2 years ago

not necessarily since it involves a bunch of expensive github api calls