Raunak Bhagat
09/10/2024, 10:29 PMRaunak Bhagat
09/10/2024, 10:45 PMcargo fmt works as expected and the entirety of the hooks succeeds.
However, after pushing to GitHub and having the daft (.github/workflows/python-package.yml) workflow run, the style job fails. The style job is internally running pre-commit run --all-files.
I ran that exact command locally and noticed that it formats additional crates that simply running cargo fmt or .git/hooks/pre-commit does not.
Anyone know why this discrepancy exists?Raunak Bhagat
09/10/2024, 10:47 PMcargo fmt. After doing that, you should notice no changes (i.e., by running git status .).
Then try entering your venv and running pre-commit run --all-files. That will format arrow2 and daft-csv. So it seems that cargo fmt didn't format those crates...Raunak Bhagat
09/10/2024, 10:49 PMRaunak Bhagat
09/10/2024, 10:51 PMRaunak Bhagat
09/10/2024, 10:52 PMcargo fmt. The GitHub action, however, runs pre-commit run --all-files.
Therefore, the local pre-commit hook succeeds, but the GitHub action fails.Raunak Bhagat
09/10/2024, 10:56 PMRaunak Bhagat
09/10/2024, 10:56 PMRaunak Bhagat
09/10/2024, 10:57 PMcargo fmt runs on all the rust files which are included in the crate hierarchy. if it's not included in the hierarchy, it will not be formatted, even if it's within the actual src dir of that crate.
But pre-commit run --all-files runs the formatter on all the files, regardless of whether or not those files are included in the crate hierarchy or not.Raunak Bhagat
09/10/2024, 11:05 PMjay
09/10/2024, 11:07 PMSammy Sidhu
09/11/2024, 1:43 AM