X Tutup
Skip to content

Add Rust support#751

Merged
asottile merged 5 commits intopre-commit:masterfrom
chriskuehl:rust
May 25, 2018
Merged

Add Rust support#751
asottile merged 5 commits intopre-commit:masterfrom
chriskuehl:rust

Conversation

@chriskuehl
Copy link
Member

@chriskuehl chriskuehl commented May 16, 2018

Here's an example hook that works: https://github.com/chriskuehl/example-rust-pre-commit-hook

Filing the PR a bit early so I can take advantage of Travis to run CI.

Still TODO:

  • Tests
  • CI support (at least Travis, hopefully AppVeyor)
  • Test it with some real Rust linters. The example one I wrote works, but I want to make sure this is actually applicable to real linters.
  • Make sure local hooks work (might need to add a blank Cargo.toml to the template)
  • (maybe one day) consider using rustup to grab a specific version of rust, rather than relying on the system installation (similar to ruby)

@asottile
Copy link
Member

:hype:! 🎉

@chriskuehl chriskuehl force-pushed the rust branch 5 times, most recently from 777800a to 05ec013 Compare May 23, 2018 04:16
Also consistently build the hook using `cargo install`.
@chriskuehl
Copy link
Member Author

Travis and AppVeyor are both passing :D

It adds about 20 seconds to the Travis pre-install step which isn't great but probably okay? (swift adds like 23 seconds /shrug)

I tested this out with shellharden, a real Rust linter (and a pretty cool one), and it seems to work. Going to try this with a couple other linters (maybe clippy) before I check off that box.

@chriskuehl
Copy link
Member Author

Tried this out with some real Rust linters: shellharden, systemd-linter, rustfmt-nightly, and clippy via the mirror maker, they all worked :D.

Gonna check off that box, just need to make local hooks work and then I think this will be good to merge.

@chriskuehl chriskuehl changed the title [WIP] Add Rust support Add Rust support May 25, 2018
@asottile asottile merged commit 065504d into pre-commit:master May 25, 2018
@chriskuehl
Copy link
Member Author

partycat

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

X Tutup