forked from unicode-org/conformance
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clang tidy - apply (unicode-org#326)
* Add plural rules to CPP * Clang-tidy applied to *.cpp * More style fixes * DDT-234 Apply clang-tidy to *.cpp * Added Clang Tidy to CI * Apply changes from clang-tidy * Make icu4c setup script more robust * Add a clang `compile_commands.txt` to assist compilation output msgs * Apply clang-tidy change * Add clang-tidy config file * Test clang-tidy run on CI to sidestep CI upload step permissions * Mod to workaround GHA permissions * Try to include json-c dependency in clang-tidy CI action * Refactor clang-tidy CI jobs into a separate workflow * Update CI job names * Change workflow name to trigger the 2nd workflow * Remove second workflow b/c it won't trigger without user PAT tokens on a PR branch * test CI by inducing a known error * Revert "test CI by inducing a known error" This reverts commit d7a90ff. * Add CLI usage for clang-tidy locally --------- Co-authored-by: Elango Cheran <[email protected]>
- Loading branch information
Showing
17 changed files
with
206 additions
and
147 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: clang-tidy-review | ||
|
||
# You can be more specific, but it currently only works on pull requests | ||
on: [pull_request] | ||
|
||
jobs: | ||
build: | ||
name: Lint ICU4C C++ executor | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
# Optionally generate compile_commands.json | ||
|
||
# Run clang-tidy | ||
# Note: when running locally at the command line, use the equivalent | ||
# command when in the directory `executors/cpp`: | ||
# clang-tidy *.cpp --fix-errors --config-file="clang-tidy-config.yml" -p . | ||
# Note: you must run setup.sh and also run install_icu4c_binary.sh (for a given ICU4C version) first | ||
# before running the above clang-tidy command | ||
- uses: ZedThree/[email protected] | ||
with: | ||
# clang-tidy specific configs | ||
build_dir: './executors/cpp' | ||
config_file: './executors/cpp/clang-tidy-config.yml' | ||
# Action-specific config | ||
split_workflow: true | ||
apt_packages: "libjson-c-dev,libicu-dev" | ||
id: review | ||
|
||
- uses: ZedThree/clang-tidy-review/[email protected] | ||
|
||
# If there are any comments, fail the check | ||
- if: steps.review.outputs.total_comments > 0 | ||
run: exit 1 |
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 @@ | ||
HeaderFilterRegex: '.*' |
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,9 @@ | ||
-L/tmp/icu/icu/usr/local/lib | ||
-I/usr/include/c++/13 | ||
-I/usr/include/x86_64-linux-gnu/c++/13 | ||
-I/usr/include/c++/13/backward | ||
-I/usr/lib/gcc/x86_64-linux-gnu/13/include | ||
-I/usr/local/include | ||
-I/usr/include/x86_64-linux-gnu | ||
-I/usr/include | ||
|
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
Oops, something went wrong.