-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[quality] consolidate lint rule implementations
This consolidates the lint rule implementations for clang_format, gofmt, and protolint, so a common rule implementation and template script is used for all lint rules, which operate in a similar fashion. Additionally, this updates the clang_format lint rule to use the clang_format binary included in the lowRISC RV32 toolchain, for improved build reproducibility. Signed-off-by: Tim Trippel <[email protected]>
- Loading branch information
1 parent
d26b688
commit b525b88
Showing
12 changed files
with
147 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env bash | ||
# Copyright lowRISC contributors (OpenTitan project). | ||
# Licensed under the Apache License, Version 2.0, see LICENSE for details. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
case "$MODE" in | ||
diff) | ||
RESULT=0 | ||
for f in $FILES; do | ||
diff -Naur "$f" <(${lint_tool} ${f}) | ||
RESULT=$(($RESULT | $?)) | ||
done | ||
exit $RESULT | ||
;; | ||
fix) | ||
echo "$FILES" | xargs ${lint_tool} -i | ||
;; | ||
*) | ||
echo "Unknown mode: $MODE" | ||
exit 2 | ||
esac |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env bash | ||
# Copyright lowRISC contributors (OpenTitan project). | ||
# Licensed under the Apache License, Version 2.0, see LICENSE for details. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
case "$MODE" in | ||
diff) | ||
echo "$FILES" | xargs ${lint_tool} -s -d | ||
exit $? | ||
;; | ||
fix) | ||
echo "$FILES" | xargs ${lint_tool} -s -w | ||
;; | ||
*) | ||
echo "Unknown mode: $MODE" | ||
exit 2 | ||
esac |
Oops, something went wrong.