dask-sql icon indicating copy to clipboard operation
dask-sql copied to clipboard

[ENH] Find alternative to `pre-commit-rust`

Open andygrove opened this issue 3 years ago • 5 comments

Is your feature request related to a problem? Please describe. I would like the pre-commit hook to run cargo test and cargo +nightly fmt so that we can format imports. These features are not implemented in pre-commit-rust, and the project seems to be unmaintained (last commit is more than 2 years ago).

There is a PR for supporting cargo test (https://github.com/doublify/pre-commit-rust/pull/25) and an issue for supporting +nightly (https://github.com/doublify/pre-commit-rust/issues/15).

Describe the solution you'd like One option would be to fork the repo. I don't know what other solutions exist for the pre-commit tool we are using.

Describe alternatives you've considered None

Additional context None

andygrove avatar Sep 27 '22 15:09 andygrove

@charlesbluca fyi

andygrove avatar Sep 27 '22 15:09 andygrove

Thanks for the ping @andygrove - agree that an alternative to pre-commit-rust would allow us to have a lot more flexibility in terms of running cargo commands as part of CI, and I don't imagine it being too difficult.

The biggest blocker I foresee here (which I've been discussing with @ayushdg) is switching over our CI and documentation to encourage the use of rustup over the conda Rust package, so that users have access to the same pre-commit environment that we are using in CI (which presumably would include nightly Rust) - I can start looking into that

charlesbluca avatar Sep 27 '22 18:09 charlesbluca

@andygrove if you test as well with nightly toolchain, it's easier to set specfic toolchain as default.

eirnym avatar May 03 '24 15:05 eirnym

This issue is pretty outdated now, the solution we ended up going with here was encouraging direct install of rustup rather than the conda packages and then using +nightly for the import formatting:

  • https://github.com/dask-contrib/dask-sql/pull/817
  • https://github.com/dask-contrib/dask-sql/pull/819

There is still the issue of pre-commit-rust being unmaintained though, so it might be worth moving some of our remaining pre-commit checks either to a fork of the repo or to local hooks.

charlesbluca avatar May 08 '24 13:05 charlesbluca

I'd like to create pre-commit-rust from the scratch. May I invite you to discuss requirements?

eirnym avatar May 08 '24 15:05 eirnym