forked from su2code/SU2
-
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.
- Loading branch information
1 parent
b48fe3e
commit 1a83235
Showing
3 changed files
with
94 additions
and
1 deletion.
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,30 @@ | ||
name: Code Style | ||
on: | ||
pull_request: | ||
paths: | ||
- "**.[ch]pp" | ||
- "**.[ch]" | ||
- "**.cfg" | ||
- "**.py" | ||
|
||
jobs: | ||
formatting: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
check-latest: true | ||
- name: Install pre-commit | ||
run: pip install pre-commit | ||
- name: Run checks | ||
run: pre-commit run -a -v | ||
- name: Git status | ||
if: always() | ||
run: git status | ||
- name: Full diff | ||
if: always() | ||
run: git diff |
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,62 @@ | ||
repos: | ||
# Official repo for the clang-format hook | ||
- repo: https://github.com/pre-commit/mirrors-clang-format | ||
rev: "v15.0.7" | ||
hooks: | ||
- id: clang-format | ||
exclude: | | ||
(?x)^( | ||
^Common/include/CConfig.hpp| | ||
^Common/include/option_structure.hpp| | ||
^Common/src/CConfig.cpp| | ||
^SU2_CFD| | ||
^externals| | ||
^subprojects| | ||
^TestCases| | ||
^legacy | ||
) | ||
types_or: [c++, c] | ||
# black repo for python formatting | ||
- repo: https://github.com/ambv/black | ||
rev: 22.6.0 | ||
hooks: | ||
- id: black | ||
exclude: | | ||
(?x)^( | ||
^SU2_CFD| | ||
^externals| | ||
^subprojects| | ||
^TestCases| | ||
^legacy | ||
) | ||
# Official repo for default hooks | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: "v4.4.0" | ||
hooks: | ||
- id: mixed-line-ending | ||
exclude: | | ||
(?x)^( | ||
^SU2_CFD| | ||
^externals| | ||
^subprojects| | ||
^TestCases| | ||
^legacy | ||
) | ||
- id: trailing-whitespace | ||
exclude: | | ||
(?x)^( | ||
^SU2_CFD| | ||
^externals| | ||
^subprojects| | ||
^TestCases| | ||
^legacy | ||
) | ||
- id: end-of-file-fixer | ||
exclude: | | ||
(?x)^( | ||
^SU2_CFD| | ||
^externals| | ||
^subprojects| | ||
^TestCases| | ||
^legacy | ||
) |