Skip to content

Conversation

glfmn
Copy link
Contributor

@glfmn glfmn commented May 21, 2018

Add a git hook with installation instructions to automate testing done on each commit. Promotes proper handling of edge cases related to testing code that will not be in the commit, which masks errors that show up later as a nasty surprise.

It's opt-in, to install it simply use:

$ ln -s ../../.pre-commit.sh .git/hooks/pre-commit
$ chmod +x .pre-commit.sh # for good measure

@glfmn
Copy link
Contributor Author

glfmn commented May 21, 2018

Just running

cargo check &&
cargo test

Is probably enough, but for sake of completeness I can always make equivalent to travis-ci with some version of:

cargo test --no-default-features
cargo test
cargo run --manifest-path systest/Cargo.toml --release

@alexcrichton
Copy link
Member

Thanks! Since hooks have to be manually set up though I'm not sure if this belongs in the repo? Perhaps this could be listed in the README with a link to a gist?

@glfmn
Copy link
Contributor Author

glfmn commented May 21, 2018

It depends on what you want to prioritize I suppose; I imagine it's less likely someone would go through the process of downloading it and copy pasting versus just doing a symlink. But I'm happy to go that route! It's definitely just my preference to do it this way.

@alexcrichton
Copy link
Member

Ok sure yeah, let's go with the route of a snippet in the README

Add a installation instructions for a git hook to automate testing
done on each commit.  Promotes proper handling of edge cases
related to testing code that will not be in the commit, which masks
errors that show up later as a nasty surprise.

Fully opt in, links to a gist on github.
@glfmn
Copy link
Contributor Author

glfmn commented May 22, 2018

Gist found here.

Updated, it should be good!

@alexcrichton alexcrichton merged commit 85da32d into rust-lang:master May 23, 2018
@alexcrichton
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants