Commit fb3506f8 authored by Alexander Jaust's avatar Alexander Jaust
Browse files

Add markdown linter to style check (CI)

This adds configuration files for markdownlint, reformats markdown files
and also updated the configuration of the CI.
parent d53d280b
Pipeline #16633 passed with stages
in 3 minutes and 30 seconds
#image: dumux-precice:3.3git-iterative-pr-2.2.0
#image: dumux-precice:3.3-2.2.1
#image: ajaust/style-check:clang-10
image: ajaust/style-check:0.1
image: ajaust/style-check:0.2
stages:
- check
......@@ -11,9 +8,8 @@ stages:
check-style-clang-10:
stage: check
script:
- ./scripts/format/run-clang-format.sh
- git diff > style-patch.diff
- if [ -s style-patch.diff ]; then echo "Download the style patch as artifact and apply it or run ./scripts/format/run-clang-format.sh and commit again."; false; fi
- ./scripts/format/run-clang-format.sh > clang-format-output.txt
- if [ -s clang-format-output.txt ]; then cat clang-format-output.txt; echo "Some files need reformatting. Check the output and run ./scripts/format/run-clang-format.sh and commit again."; false; fi
needs: []
artifacts:
when: on_failure
......@@ -24,17 +20,16 @@ check-style-clang-10:
check-style-black:
stage: check
script:
- sudo apt-get update && sudo apt-get install -y python3 python3-distutils python-is-python3 wget
- wget https://bootstrap.pypa.io/get-pip.py && python get-pip.py && rm get-pip.py && ln -sf ${HOME}/.local/bin/pip3 ${HOME}/.local/bin/pip && export PATH="${HOME}/.local/bin":"${PATH}" && pip install black
- pip install --user black
- black .
- git diff > python-style-patch.diff
- if [ -s python-style-patch.diff ]; then echo "Download the style patch as artifact and apply it or run black . and commit again."; false; fi
needs: []
artifacts:
when: on_failure
paths:
- python-style-patch.diff
expire_in: 2 days
check-style-markdownlint:
stage: check
script:
- sudo gem install mdl
- mdl .
needs: []
.build_template: &build-tests
stage: build
......
# Enable all rules by default
all
######################################################
# Deactivated/excluded rules
######################################################
######################################################
# Adapted rules
######################################################
# Enforce dashes as symvol in lists
rule 'MD004', :style => :dash
# Enforce indent with four space characters. This helps with
# mixing ordered and unordered lists
rule 'MD007', :indent => 4
# Extend line length for text.
# This will complain for overly wide tables and code blocks.
rule 'MD013', :line_length => 99999
# Nested lists should be indented with four spaces.
# Modification: Question marks should be allowed
rule 'MD026', :punctuation => '.,;:!'
# Ordered lists must have prefix that increases in order
rule 'MD029', :style => :ordered
# Load style file (ruby script)
style '.mdl.rb'
\ No newline at end of file
......@@ -2,6 +2,8 @@
## Not released yet
- 2022-05-17: Added configuation for Markdown linter `markdownlint` and added it to CI. The linter can be called locally by typing `mdl .` from the root of the repository. This also led to an updated configuration of the CI.
- 2022-05-17: Add some more documentation on how to install the adapter to the `README.md`.
- 2022-02-18: Updated CI to use images from account `ajaust` from Dockerhub. Changed tolerance for partitioned tests to 5e-5 due to minimal changes in the solution with the new images on a new VM.
- 2022-02-09: Made sure all private member of the adapter are suffixed with an underscore.
- 2022-02-01: Add some extra information on the documentation in the `README.md`. Removed old/out-of-date mkdocs documentation from `doc/mkdocs`.
......@@ -13,10 +15,10 @@
- 2022-01-25: Added [description templates](https://docs.gitlab.com/ee/user/project/description_templates.html) for merge requests and issues.
- 2022-01-12: The repository has been restructured. The main changes are:
- The adapter is now called `CouplingAdapter` and resides in `dumux-precice/`. The build process has been adapted accordingly.
- Tests case reside in `test/` directory and there in the corresponding subdirectory depending on whether it is a `monolithic`ly or `partitioned`ly coupled test case.
- Other example cases reside in the directory `examples/`. This is mainly the directory called `appl/` before, but with a new folder structure.
- The configuration of tests has been changed such that it is possible to build all tests using the `build_tests` target.
- The adapter is now called `CouplingAdapter` and resides in `dumux-precice/`. The build process has been adapted accordingly.
- Tests case reside in `test/` directory and there in the corresponding subdirectory depending on whether it is a `monolithic`ly or `partitioned`ly coupled test case.
- Other example cases reside in the directory `examples/`. This is mainly the directory called `appl/` before, but with a new folder structure.
- The configuration of tests has been changed such that it is possible to build all tests using the `build_tests` target.
For details check out the merge request [!18 Restructure repository and tests](https://git.iws.uni-stuttgart.de/dumux-appl/dumux-precice/-/merge_requests/18)
- 2022-01-10: Add license file. The code is licensed under GPLv3 without template exception.
......
......@@ -21,12 +21,12 @@ The DuMuX-preCICE adapter is a DUNE module named `dumux-precice` which can be bu
- DuMuX **newer** than 3.2
- Builds using the current `master` branch of DuMuX might fail.
- If you run into trouble with a new DuMuX release, please open an issue in the repository and add the error message that you receive.
- Builds using the current `master` branch of DuMuX might fail.
- If you run into trouble with a new DuMuX release, please open an issue in the repository and add the error message that you receive.
- preCICE >=2.0.0
- The adapter is build via the DUNE build system that is based on CMake. Thus, the CMake [link instructions for preCICE](https://precice.org/installation-linking.html#cmake) apply.
- The adapter is build via the DUNE build system that is based on CMake. Thus, the CMake [link instructions for preCICE](https://precice.org/installation-linking.html#cmake) apply.
- `wget` or `git` to download the DuMuX-preCICE adapter.
- Optional: [`dune-subgrid`](https://www.dune-project.org/modules/dune-subgrid/) allows for modified grid geometries.
......@@ -124,4 +124,4 @@ There is no publication related to this code available yet.
### Publications using dumux-precice
- Jaust A., Weishaupt K., Mehl M., Flemisch B. (2020) Partitioned Coupling Schemes for Free-Flow and Porous-Media Applications with Sharp Interfaces. In: Klöfkorn R., Keilegavlen E., Radu F., Fuhrmann J. (eds) Finite Volumes for Complex Applications IX - Methods, Theoretical Aspects, Examples. FVCA 2020. Springer Proceedings in Mathematics & Statistics, vol 323. Springer, Cham. <https://doi.org/10.1007/978-3-030-43651-3_57>
- Code can be found at: <https://git.iws.uni-stuttgart.de/dumux-pub/jaust2020a>
- Code can be found at: <https://git.iws.uni-stuttgart.de/dumux-pub/jaust2020a>
#!/usr/bin/env sh
set -e
# Runs clang-format on all *.cc and *.hh files
find dumux-precice/ -regex '.*\.\(cc\|hh\)' -exec clang-format-10 -style=file -i {} \;
find examples/ -regex '.*\.\(cc\|hh\)' -exec clang-format-10 -style=file -i {} \;
find postprocessing/ -regex '.*\.\(cc\|hh\|hpp\|cpp\)' -exec clang-format-10 -style=file -i {} \;
find dumux-precice/ -regex '.*\.\(cc\|hh\)' -exec clang-format-10 --dry-run -style=file -i {} \;
find examples/ -regex '.*\.\(cc\|hh\)' -exec clang-format-10 --dry-run -style=file -i {} \;
find postprocessing/ -regex '.*\.\(cc\|hh\|hpp\|cpp\)' -exec clang-format-10 --dry-run -style=file -i {} \;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment