-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
eliminate tabs and trailing whitespace (#429)
+ setup a github action
- Loading branch information
Showing
48 changed files
with
395 additions
and
300 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Style | ||
|
||
on: [push, pull_request] | ||
|
||
concurrency: | ||
group: ${{ github.ref }}-${{ github.head_ref }}-style | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
tabs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Tabs | ||
run: .github/workflows/style/check_tabs.sh | ||
|
||
trailing_whitespaces: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Trailing Whitespaces | ||
run: .github/workflows/style/check_trailing_whitespaces.sh |
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 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eu -o pipefail | ||
|
||
find . -type d \( -name .git \ | ||
-o -path ./paper \ | ||
-o -name build -o -name install \ | ||
-o -name tmp_build_dir -o -name tmp_install_dir \ | ||
\) -prune -o \ | ||
-type f \( \( -name "*.H" -o -name "*.h" -o -name "*.hh" -o -name "*.hpp" \ | ||
-o -name "*.c" -o -name "*.cc" -o -name "*.cpp" -o -name "*.cxx" \ | ||
-o -name "*.f" -o -name "*.F" -o -name "*.f90" -o -name "*.F90" \ | ||
-o -name "*.py" \ | ||
-o -name "*.md" -o -name "*.rst" \ | ||
-o -name "*.sh" \ | ||
-o -name "*.tex" \ | ||
-o -name "*.txt" \ | ||
-o -name "*.yml" \) \ | ||
-a \( ! -name "*.tab.h" -a ! -name "*.tab.nolint.H" \ | ||
-a ! -name "*.lex.h" -a ! -name "*.lex.nolint.H" \) \ | ||
\) \ | ||
-exec grep -Iq . {} \; \ | ||
-exec sed -i 's/\t/\ \ \ \ /g' {} + | ||
|
||
gitdiff=`git diff` | ||
|
||
if [ -z "$gitdiff" ] | ||
then | ||
exit 0 | ||
else | ||
echo -e "\nTabs are not allowed. Changes suggested by" | ||
echo -e " ${0}\n" | ||
git --no-pager diff | ||
echo "" | ||
exit 1 | ||
fi |
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,38 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eu -o pipefail | ||
|
||
find . -type d \( -name .git \ | ||
-o -path ./paper \ | ||
-o -name build -o -name install \ | ||
-o -name tmp_build_dir -o -name tmp_install_dir \ | ||
-o -path ./util/gcem \ | ||
\) -prune -o \ | ||
-type f \( \( -name "*.H" -o -name "*.h" -o -name "*.hh" -o -name "*.hpp" \ | ||
-o -name "*.c" -o -name "*.cc" -o -name "*.cpp" -o -name "*.cxx" \ | ||
-o -name "*.f" -o -name "*.F" -o -name "*.f90" -o -name "*.F90" \ | ||
-o -name "*.py" \ | ||
-o -name "*.rst" \ | ||
-o -name "*.sh" \ | ||
-o -name "*.tex" \ | ||
-o -name "*.txt" \ | ||
-o -name "*.yml" \) \ | ||
-a \( ! -name "*.tab.h" -a ! -name "*.tab.nolint.H" \ | ||
-a ! -name "*.lex.h" -a ! -name "*.lex.nolint.H" \ | ||
-a ! -path "./networks/*/reaclib_rates.H" \) \ | ||
\) \ | ||
-exec grep -Iq . {} \; \ | ||
-exec sed -i 's/[[:blank:]]\+$//g' {} + | ||
|
||
gitdiff=`git diff` | ||
|
||
if [ -z "$gitdiff" ] | ||
then | ||
exit 0 | ||
else | ||
echo -e "\nTrailing whitespaces at the end of a line are not allowed. Changes suggested by" | ||
echo -e " ${0}\n" | ||
git --no-pager diff | ||
echo "" | ||
exit 1 | ||
fi |
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
Oops, something went wrong.