From 706bfa70c144775126e15a960028d3b3df7980fb Mon Sep 17 00:00:00 2001 From: Kurtis Rader Date: Tue, 12 Apr 2016 19:57:07 -0700 Subject: improve the style.fish script If there are uncommitted changes use `git-clang-format` to limit the style fixups to the lines being modified. Refuse to do a `make style-all` if there are uncommitted changes. Include a fix for the parsing of `git status` output that was recently incorporated into the lint.fish script. --- CONTRIBUTING.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'CONTRIBUTING.md') diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2c847319..e73bc344 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -40,7 +40,9 @@ The following sections discuss the specific rules for the style that should be u make style ``` -before commiting your change. If you've already committed your changes that's okay since it will then check the files in the most recent commit. This can be useful after you've merged someone elses change and want to check that it's style is acceptable. +before commiting your change. That will run `git-clang-format` to rewrite just the lines you're modifying. + +If you've already committed your changes that's okay since it will then check the files in the most recent commit. This can be useful after you've merged someone elses change and want to check that it's style is acceptable. However, in that case it will run `clang-format` to ensure the entire file, not just the lines modified by the commit, conform to the style. If you want to check the style of the entire code base run @@ -48,6 +50,8 @@ If you want to check the style of the entire code base run make style-all ``` +That command will refuse to restyle any files if you have uncommitted changes. + ### Suppressing Reformatting of the Code If you have a good reason for doing so you can tell `clang-format` to not reformat a block of code by enclosing it in comments like this: -- cgit v1.2.3