-
Notifications
You must be signed in to change notification settings - Fork 674
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve pre-commit workflow in CI (#1602)
* clang-tidy run only modified + add gersemi * cmake linewidth 80 * move fetch step and remove cmake-format * install clang-tidy as python package * update alpine version + enable venv * ignore venv directory * fix path * add setuptools * fallback to 3.17 * move venv to .venv * remove cmake-format config + add gersemirc * format all for gersemi * format modified lines * remove pin of pre-commit * change indent to 2 * remove unused config lines * remove clang-tidy from cmake * Fix for comments
- Loading branch information
Showing
19 changed files
with
197 additions
and
373 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
[codespell] | ||
skip = *.dat,typos-config.toml,.git,./ci,./Dist,./mk,./Tests/ExamplesTest/expected_output,./Tests/ExamplesTest/pcap_examples,./Tests/Packet++Test/PacketExamples,./Tests/Pcap++Test/PcapExamples,./3rdParty,./Examples/PcapSearch/dirent-for-Visual-Studio | ||
skip = *.dat,typos-config.toml,.git,.venv,./ci,./Dist,./mk,./Tests/ExamplesTest/expected_output,./Tests/ExamplesTest/pcap_examples,./Tests/Packet++Test/PacketExamples,./Tests/Pcap++Test/PcapExamples,./3rdParty,./Examples/PcapSearch/dirent-for-Visual-Studio | ||
ignore-words = codespell-ignore-list.txt | ||
count = |
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,6 @@ | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/BlankSpruce/gersemi/master/gersemi/configuration.schema.json | ||
|
||
indent: 2 | ||
line_length: 120 | ||
list_expansion: favour-inlining | ||
warn_about_unknown_commands: false |
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
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,35 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
SCRIPT=$(readlink -f "$0") | ||
SCRIPTPATH=$(dirname "${SCRIPT}") | ||
ROOTPATH=$(realpath "${SCRIPTPATH}"/..) | ||
if ! command -v clang-tidy; then | ||
echo "clang-tidy is not found!" | ||
exit 1 | ||
fi | ||
|
||
# Determine the mode (all files or changed files) | ||
MODE=${1:-all} | ||
BUILD_DIR=${2:-build} | ||
|
||
if [ "$MODE" = "changed" ]; then | ||
# Get the list of changed files from origin/dev | ||
git fetch origin dev | ||
files=$(git diff --name-only origin/dev -- '*.cpp' '*.h' | grep -v '3rdParty/' || true) | ||
else | ||
# Find all relevant files | ||
files=$(find "${ROOTPATH}" -type f \( -name '*.cpp' -o -name '*.h' \) -not -path "*/3rdParty/*") | ||
fi | ||
|
||
# Check if there are any files to process | ||
if [ -z "$files" ]; then | ||
echo "No files to process." | ||
exit 0 | ||
fi | ||
|
||
# Process each file | ||
echo "$files" | while IFS= read -r file; do | ||
echo "Checking: $file" | ||
clang-tidy "$file" -p $BUILD_DIR --fix --checks=modernize-use-nullptr,modernize-use-override,performance-unnecessary-value-param | ||
done |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.