Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix formatting pre-commit check #28

Merged
merged 3 commits into from
Feb 26, 2016
Merged

Conversation

tikue
Copy link
Collaborator

@tikue tikue commented Feb 25, 2016

The hashing didn't work, so I replaced it with write-mode=diff.

I also print the diff if the formatting check fails. Example:

$ git commit -am "Test commit"
[PRECOMMIT] Checking that all filenames are ascii ... ok
[PRECOMMIT] Checking for bad whitespace ... ok
[PRECOMMIT] Checking for rustfmt ... ok
[PRECOMMIT] Checking for shasum ... ok
[PRECOMMIT] Checking formatting ... FAILED
Diff of tarpc/src/protocol/mod.rs:


Diff at line 19:
 pub use self::client::{Client, Future};⏎
 pub use self::server::{Serve, ServeHandle};⏎
 ⏎
-pub mod test_fmt { }⏎
+pub mod test_fmt {}⏎
 ⏎
 /// Client errors that can occur during rpc calls⏎
 #[derive(Debug, Clone)]⏎

* shasum suffixes the checksum with '- filename' so pipe in the text instead.
* rustfmt prefixes the formatting with 'Using rustfmt config file filename' so pipe in the text instead.
shaladdle added a commit that referenced this pull request Feb 26, 2016
Fix formatting pre-commit check
@shaladdle shaladdle merged commit 2eb0b2c into google:master Feb 26, 2016
@tikue tikue deleted the fix-pre-commit branch September 16, 2016 23:21
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