-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add and apply pre-commit config (#10)
* Add pre-commit * Format docs * Format preCICE config * Integrate pep8 into pre-commit * Fix formatting * Update .github/workflows/code-style.yml Co-authored-by: Benjamin Uekermann <benjamin.uekermann@ipvs.uni-stuttgart.de> --------- Co-authored-by: Benjamin Uekermann <benjamin.uekermann@ipvs.uni-stuttgart.de>
- Loading branch information
Showing
7 changed files
with
96 additions
and
59 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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Code Style | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
pull_request: | ||
branches: | ||
- "*" | ||
|
||
jobs: | ||
formatting: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the FMI Runner | ||
uses: actions/checkout@v4 | ||
- name: Setup python | ||
uses: actions/setup-python@v5 | ||
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,5 @@ | ||
{ | ||
"MD013": false, | ||
"MD033": false, | ||
"MD034": 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
repos: | ||
# Official repo for default hooks | ||
- repo: https://github.com/precice/precice-pre-commit-hooks | ||
rev: 'v3.2' | ||
hooks: | ||
- id: format-precice-config | ||
files: "^.*/precice-config.xml" | ||
- id: check-image-prefix | ||
args: [ --prefix=docs-tooling-fmi-runner- ] | ||
- repo: https://github.com/igorshubovych/markdownlint-cli | ||
rev: v0.39.0 | ||
hooks: | ||
- id: markdownlint | ||
files: "^docs/.*.md" | ||
- id: markdownlint-fix | ||
files: "^docs/.*.md" | ||
- repo: https://github.com/hhatto/autopep8 | ||
rev: v2.0.4 | ||
hooks: | ||
- id: autopep8 | ||
args: [ --in-place, --ignore=E402, --max-line-length=120 ] |
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
File renamed without changes
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,50 +1,53 @@ | ||
<?xml version="1.0"?> | ||
|
||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<precice-configuration> | ||
|
||
<log> | ||
<sink type="stream" output="stdout" filter= "%Severity% > debug" format="preCICE:%ColorizedSeverity% %Message%" enabled="true" /> | ||
<sink | ||
type="stream" | ||
output="stdout" | ||
filter="%Severity% > debug" | ||
format="preCICE:%ColorizedSeverity% %Message%" | ||
enabled="true" /> | ||
</log> | ||
|
||
<solver-interface dimensions="2" > | ||
|
||
<data:scalar name="dataOne" /> | ||
<data:scalar name="dataTwo" /> | ||
|
||
<solver-interface dimensions="2"> | ||
<data:scalar name="dataOne" /> | ||
<data:scalar name="dataTwo" /> | ||
<mesh name="MeshOne"> | ||
<use-data name="dataOne" /> | ||
<use-data name="dataTwo" /> | ||
</mesh> | ||
|
||
<mesh name="MeshTwo"> | ||
<use-data name="dataOne" /> | ||
<use-data name="dataTwo" /> | ||
</mesh> | ||
|
||
<participant name="SolverOne"> | ||
<use-mesh name="MeshOne" provide="yes"/> | ||
<use-mesh name="MeshOne" provide="yes" /> | ||
<write-data name="dataOne" mesh="MeshOne" /> | ||
<read-data name="dataTwo" mesh="MeshOne" /> | ||
<read-data name="dataTwo" mesh="MeshOne" /> | ||
</participant> | ||
|
||
<participant name="SolverTwo"> | ||
<use-mesh name="MeshOne" from="SolverOne"/> | ||
<use-mesh name="MeshTwo" provide="yes"/> | ||
<mapping:nearest-neighbor direction="write" from="MeshTwo" to="MeshOne" constraint="conservative"/> | ||
<mapping:nearest-neighbor direction="read" from="MeshOne" to="MeshTwo" constraint="consistent" /> | ||
<use-mesh name="MeshOne" from="SolverOne" /> | ||
<use-mesh name="MeshTwo" provide="yes" /> | ||
<mapping:nearest-neighbor | ||
direction="write" | ||
from="MeshTwo" | ||
to="MeshOne" | ||
constraint="conservative" /> | ||
<mapping:nearest-neighbor | ||
direction="read" | ||
from="MeshOne" | ||
to="MeshTwo" | ||
constraint="consistent" /> | ||
<write-data name="dataTwo" mesh="MeshTwo" /> | ||
<read-data name="dataOne" mesh="MeshTwo" /> | ||
<read-data name="dataOne" mesh="MeshTwo" /> | ||
</participant> | ||
|
||
<m2n:sockets from="SolverOne" to="SolverTwo" exchange-directory=".."/> | ||
|
||
<coupling-scheme:serial-explicit> | ||
<participants first="SolverOne" second="SolverTwo" /> | ||
<m2n:sockets from="SolverOne" to="SolverTwo" exchange-directory=".." /> | ||
<coupling-scheme:serial-explicit> | ||
<participants first="SolverOne" second="SolverTwo" /> | ||
<max-time-windows value="5" /> | ||
<time-window-size value="1.0" /> | ||
<exchange data="dataOne" mesh="MeshOne" from="SolverOne" to="SolverTwo" /> | ||
<exchange data="dataTwo" mesh="MeshOne" from="SolverTwo" to="SolverOne"/> | ||
</coupling-scheme:serial-explicit> | ||
<exchange data="dataTwo" mesh="MeshOne" from="SolverTwo" to="SolverOne" /> | ||
</coupling-scheme:serial-explicit> | ||
</solver-interface> | ||
|
||
</precice-configuration> |