Closed hdadhich01 closed 1 year ago
Most probably the discrepancy is caused by the fact that pre-commit hooks create the python virtual environment with all the required dependencies on their first run, after that the virtual environment is just reused and not recreated. The same applies on the CI, with the only difference that the environment is always clean, hence the new version of the direct and indirect dependencies are fetched.
Are you able to reproduce the same issue after running pre-commit clean
and then running the pre-commit hooks again?
Yes, seems to perform the same despite cleaning the hook environments.
Sorry, I might have missed the detail that your local-formatter is not a local-run of the pre-commit hook.
What I would deduce is that the two pre-commit hooks are attempting to enforce different styles.
I think that if the tool were to expose --offset
configuration you could be able to achieve "equal formatting".
Going to be implementing it in #143
Great, thanks! Could you put out a release tag sometime soon?
My local YAML formatter places an initial indent after the parent keyword in a
.pre-commit-config.yaml
file. Thepretty-format-yaml
hook formats it differently. I was wondering what the reason was for the discrepancy.Local Formatter
Hook Formatter