Skip to content
Snippets Groups Projects
Commit 43bab6c4 authored by Sergey Kosukhin's avatar Sergey Kosukhin
Browse files

CI: extend check style for Fortran

parent 3d61a371
No related branches found
No related tags found
1 merge request!24Format C with clang-format and Fortran with fprettify
Pipeline #70264 failed
......@@ -45,12 +45,25 @@ check_style:
RED: '\033[0;31m'
STYLE_PATCH: ${CI_PROJECT_DIR}/style.patch
before_script:
- apk add git clang-extra-tools
- apk add git clang-extra-tools python3 py3-pip
# We use --break-system-packages because fprettify is not installable via
# "apk add py3-fprettify":
- python -m pip install --break-system-packages fprettify
script:
# Exclude the automatically generated mtime_iso8601.c:
- >-
clang-format --style=file -i
$(find ${CI_PROJECT_DIR} -name 'mtime_iso8601.c' -prune -o \( -name '*.h' -o -name '*.c' \) -print)
# We do not use a config file but specify the formatting arguments on the
# command line because the feature does not work for certain arguments even
# in the latest release
# (e.g., see https://github.com/pseewald/fprettify/issues/94):
- >-
fprettify
--case 2 2 2 1
--indent 2
--whitespace 2
--recursive ${CI_PROJECT_DIR}
- git -C ${CI_PROJECT_DIR} diff --patch-with-raw > ${STYLE_PATCH}
- |
# Test if patching is necessary:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment