forked from rime/weasel
-
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.
ci: add code style lint to commit ci
- Loading branch information
Showing
4 changed files
with
55 additions
and
0 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,9 @@ | ||
stdafx | ||
targetver | ||
resource.h | ||
winapifamily | ||
winpackagefamily | ||
winsparkle | ||
immdev.h | ||
SystemTraySDK.h | ||
ctffunc.h |
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 | ||
|
||
WEASEL_SOURCE_PATH="RimeWithWeasel WeaselDeployer WeaselIME WeaselIPC WeaselIPCServer WeaselServer WeaselSetup WeaselTSF WeaselUI include test" | ||
|
||
# clang format options | ||
method="-i" | ||
|
||
while getopts "in" option; do | ||
case "${option}" in | ||
n) # format code | ||
find ${WEASEL_SOURCE_PATH} -name '*.cpp' -o -name '*.h' ! -path "include/wtl/*" | grep -wiv -f .exclude_pattern.txt | xargs clang-format --verbose -i | ||
;; | ||
i) # dry run and changes formatting warnings to errors | ||
find ${WEASEL_SOURCE_PATH} -name '*.cpp' -o -name '*.h' ! -path "include/wtl/*" | grep -wiv -f .exclude_pattern.txt | xargs clang-format --verbose -Werror --dry-run || { echo Please lint your code by '"'"./clang-format.sh -n"'"'.; false; } | ||
;; | ||
\?) # invalid option | ||
echo "invalid option, please use -i or -n." | ||
exit 1 | ||
;; | ||
esac | ||
done |
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,18 @@ | ||
@echo off | ||
|
||
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" ( | ||
rem 64 bit system | ||
rem powershell -Command "(New-Object Net.WebClient).DownloadFile('https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.6/LLVM-17.0.6-win64.exe', 'LLVM-17.0.6-win64.exe')" | ||
rem LLVM-17.0.6-win64.exe /S | ||
rem or maybe | ||
rem output/7z.exe e LLVM-17.0.6-win64.exe bin/clang-format.exe -o. | ||
rem rm LLVM-17.0.6-win64.exe | ||
) else ( | ||
rem 32 bit system | ||
rem powershell -Command "(New-Object Net.WebClient).DownloadFile('https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.6/LLVM-17.0.6-win32.exe', 'LLVM-17.0.6-win32.exe')" | ||
rem LLVM-17.0.6-win32.exe /S | ||
rem or maybe | ||
rem output/7z.exe e LLVM-17.0.6-win32.exe bin/clang-format.exe -o. | ||
rem rm LLVM-17.0.6-win32.exe | ||
) | ||
pause |