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

check-byte-order-marker deprecation #645

Closed
Dunedan opened this issue Aug 31, 2021 · 8 comments
Closed

check-byte-order-marker deprecation #645

Dunedan opened this issue Aug 31, 2021 · 8 comments

Comments

@Dunedan
Copy link
Contributor

Dunedan commented Aug 31, 2021

As part of #522 the check-byte-order-marker hook got deprecated. If I'm not mistaken there is no replacement hook for the same functionality (checking for BOMs, but not removing them automatically). Am I missing something or why did the check-byte-order-marker hook get deprecated?

For our use case we never want pre-commit hooks to change files automatically, but only act as a way to detect violations.

@asottile
Copy link
Member

yeah it has been moved to fixer only

@Dunedan
Copy link
Contributor Author

Dunedan commented Sep 1, 2021

yeah it has been moved to fixer only

Well yes, that's what I also mentioned in my question. I'm still trying to understand why change was made. Can you please elaborate on that?

@asottile
Copy link
Member

asottile commented Sep 1, 2021

fixers are significantly less toilsome than checkers

@Dunedan
Copy link
Contributor Author

Dunedan commented Sep 1, 2021

In which regard are they less toilsome? To develop or to use?

For usage I believe it's important to have hooks which only report issues, but don't attempt to fix them. Actually that's how I (and I believe other users as well) use pre-commit exclusively.

Hooks which try to automatically fix something are undesirable in situations where users want to be in control what gets committed and want to review all changes prior to committing.

@asottile
Copy link
Member

asottile commented Sep 1, 2021

I think you misunderstand how pre-commit works. hooks may change files but they never are automatically committed in that way (the commit is aborted)

@Dunedan
Copy link
Contributor Author

Dunedan commented Sep 2, 2021

I was indeed ignorant about what pre-commit exactly does when modifying files. That doesn't however change my preference that I don't want pre-commit to modify files at all.

I still don't understand if hooks are more toilsome to develop or to use. I'd be grateful if you could elaborate on that.

Also what's the strategy for this repository? Remove all check-only hooks eventually? Replace check-only hooks with fixer hooks once a fixer hook becomes available? Something different?

Would you be open for PRs adding check-only functionality to hooks which currently only support fixing?

@asottile
Copy link
Member

asottile commented Sep 2, 2021

I'm more interested in maintaining fixers than checkers and where possible will be replacing them and not maintaining checkers

checkers are a worse experience for users. computers are really good at fixing things so just let them do it

I will not be accepting PRs to add check-only modes

@Dunedan
Copy link
Contributor Author

Dunedan commented Sep 2, 2021

Thanks for your explanations. Much appreciated. 🙂

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

No branches or pull requests

2 participants