Patrick Georgi has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31654
Change subject: util/lint: Fix clang-format test and enable it by default ......................................................................
util/lint: Fix clang-format test and enable it by default
git diff needed to emit diffs without prefix (e.g. a/ and b/) for clang-format-diff to be able to work.
Also require that the test succeeds.
Change-Id: I7e9a32eb9281b5cb0b45506a206500fd1d315372 Signed-off-by: Patrick Georgi pgeorgi@google.com --- R util/lint/lint-stable-022-clang-format 1 file changed, 5 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/54/31654/1
diff --git a/util/lint/lint-022-clang-format b/util/lint/lint-stable-022-clang-format similarity index 79% rename from util/lint/lint-022-clang-format rename to util/lint/lint-stable-022-clang-format index 932d9c0..bd662e4 100755 --- a/util/lint/lint-022-clang-format +++ b/util/lint/lint-stable-022-clang-format @@ -30,5 +30,9 @@ fi
if [ $(clang-format $files_to_check | wc -l) -gt 0 ]; then - git diff HEAD~..HEAD -- $files_to_check | clang-format-diff + if [ "$(git diff --no-prefix HEAD~..HEAD -- $files_to_check | clang-format-diff)" != "" ]; then + echo "Coding style mismatch. The following patch fixes it:" + git diff --no-prefix HEAD~..HEAD -- $files_to_check | clang-format-diff + exit 1 + fi fi
Martin Roth has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31654 )
Change subject: util/lint: Fix clang-format test and enable it by default ......................................................................
Patch Set 1: Code-Review+2
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31654 )
Change subject: util/lint: Fix clang-format test and enable it by default ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/#/c/31654/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/#/c/31654/1//COMMIT_MSG@13 PS1, Line 13: Please clarify, that the test only affects files mentioned in the clang format scope configuration file. (If I am not mistaken.)
Hello build bot (Jenkins), Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/31654
to look at the new patch set (#2).
Change subject: util/lint: Fix clang-format test and enable it by default ......................................................................
util/lint: Fix clang-format test and enable it by default
git diff needed to emit diffs without prefix (e.g. a/ and b/) for clang-format-diff to be able to work.
Also require that the test succeeds, but note that it only runs on trees whitelisted in $(top)/.clang-format-scope.
Change-Id: I7e9a32eb9281b5cb0b45506a206500fd1d315372 Signed-off-by: Patrick Georgi pgeorgi@google.com --- R util/lint/lint-stable-022-clang-format 1 file changed, 5 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/54/31654/2
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31654 )
Change subject: util/lint: Fix clang-format test and enable it by default ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/#/c/31654/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/#/c/31654/1//COMMIT_MSG@13 PS1, Line 13:
Please clarify, that the test only affects files mentioned in the clang format scope configuration f […]
Done
Patrick Georgi has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/31654 )
Change subject: util/lint: Fix clang-format test and enable it by default ......................................................................
util/lint: Fix clang-format test and enable it by default
git diff needed to emit diffs without prefix (e.g. a/ and b/) for clang-format-diff to be able to work.
Also require that the test succeeds, but note that it only runs on trees whitelisted in $(top)/.clang-format-scope.
Change-Id: I7e9a32eb9281b5cb0b45506a206500fd1d315372 Signed-off-by: Patrick Georgi pgeorgi@google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/31654 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Martin Roth martinroth@google.com --- R util/lint/lint-stable-022-clang-format 1 file changed, 5 insertions(+), 1 deletion(-)
Approvals: build bot (Jenkins): Verified Martin Roth: Looks good to me, approved
diff --git a/util/lint/lint-022-clang-format b/util/lint/lint-stable-022-clang-format similarity index 79% rename from util/lint/lint-022-clang-format rename to util/lint/lint-stable-022-clang-format index 932d9c0..bd662e4 100755 --- a/util/lint/lint-022-clang-format +++ b/util/lint/lint-stable-022-clang-format @@ -30,5 +30,9 @@ fi
if [ $(clang-format $files_to_check | wc -l) -gt 0 ]; then - git diff HEAD~..HEAD -- $files_to_check | clang-format-diff + if [ "$(git diff --no-prefix HEAD~..HEAD -- $files_to_check | clang-format-diff)" != "" ]; then + echo "Coding style mismatch. The following patch fixes it:" + git diff --no-prefix HEAD~..HEAD -- $files_to_check | clang-format-diff + exit 1 + fi fi
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31654 )
Change subject: util/lint: Fix clang-format test and enable it by default ......................................................................
Patch Set 3:
(1 comment)
I don't think this is something that many people will be happy about either. These tools aren't perfect and sometimes you *want* to ignore style in specific cases. Looks to me like this isn't actually doing anything right now due to the lack of a scope file(?), but if you plan to add that later, it's probably going to bring trouble as well.
https://review.coreboot.org/#/c/31654/3//COMMIT_MSG Commit Message:
https://review.coreboot.org/#/c/31654/3//COMMIT_MSG@13 PS3, Line 13: $(top)/.clang-format-scope I may be blind, but I don't see that file anywhere in the tree. Where is it? Or is this only supposed to be for out-of-tree payloads?