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

make auto-fixing (source alteration) user controlable #922

Closed
ssbarnea opened this issue Jan 24, 2019 · 3 comments
Closed

make auto-fixing (source alteration) user controlable #922

ssbarnea opened this issue Jan 24, 2019 · 3 comments
Labels

Comments

@ssbarnea
Copy link

Based on feedback received from various users it seems that there are two parties, both big: one that likes auto-fixing code and one that doesn't like to touch the code after running.

Can we define an environment variable like PRE_COMMIT_AUTOFIX=[0|1] which could tell the hooks to touch (fix) or not to touch the source code when running?

Example hooks: end-of-file-fixer and trailing-whitespace.

@asottile
Copy link
Member

asottile commented Jan 24, 2019

I don't think that would help, there are only a few executables under control of pre-commit and to be frank the party that doesn't want their code edited I believe to be in the wrong. Even if the few fixers pre-commit can influence implemented this option there's far more that would oppose implementing something like this.

what's the target workflow of one of these individuals? can they run git checkout -- . and then it's as-if the fixers never ran?

@asottile
Copy link
Member

asottile commented Feb 2, 2019

@ssbarnea bump!

@asottile
Copy link
Member

closing due to inactivity

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

No branches or pull requests

2 participants