-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #340 from earth-system-radiation/develop
Minor updates - c_bool always, more CI, code formatting and pre-commit.
- Loading branch information
Showing
82 changed files
with
1,429 additions
and
1,292 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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
# Formatted entire CMake code base with cmake-format | ||
45b43632309cff022326472a8be0fdd5efc8f5c8 | ||
# Formatted entire codebase (#337) | ||
db7044f9c85b9675b0447d2162001f32b61e0e84 | ||
cc0f75b44d536fd10fa0556474926e58bfbb3f4f | ||
71520f8bcc8af9611e2a0f70eb3278fcc3064343 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -143,4 +143,3 @@ switch_for_module () | |
eval "$sfm_cmd" | ||
done | ||
} | ||
|
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 |
---|---|---|
|
@@ -9,64 +9,15 @@ on: | |
- documentation | ||
workflow_dispatch: | ||
|
||
env: | ||
FIND_CMAKE_FILES_CMD: "find '${{ github.workspace }}' -name 'CMakeLists.txt' -o -name '*.cmake' -o -name '*.cmake.in'" | ||
|
||
jobs: | ||
Format: | ||
runs-on: ubuntu-22.04 | ||
env: | ||
DEFAULT: '\033[0m' | ||
RED: '\033[0;31m' | ||
GREEN: '\033[0;32m' | ||
FORMAT_PATCH: '${{ github.workspace }}/format.patch' | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
- name: Install Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '>=3.8' | ||
- name: Install required tools | ||
run: python -m pip install cmake-format | ||
- name: Format CMake | ||
run: cmake-format -i $(eval "${FIND_CMAKE_FILES_CMD}") | ||
- name: Check if patching is required | ||
id: patch-required | ||
run: | | ||
git -C '${{ github.workspace }}' diff --patch-with-raw > "${FORMAT_PATCH}" | ||
test -s "${FORMAT_PATCH}" && { | ||
printf "${RED}The source code does not meet the format requirements. \ | ||
Please, apply the patch (see artifacts).${DEFAULT}\n" | ||
printf "${RED}Note that the result of the formatting might depend \ | ||
on the versions of the formatting tools. In this project, whatever \ | ||
formatting this CI job produces if the correct one. If it expects \ | ||
you to reformat parts of the source code that you did not modify, do \ | ||
so in a separate commit, which must not be squashed, and list the \ | ||
commit in the '.git-blame-ignore-revs' file.${DEFAULT}\n" | ||
exit 1 | ||
} || { | ||
printf "${GREEN}The source code meets the format requirements.${DEFAULT}\n" | ||
rm -rf "${FORMAT_PATCH}" | ||
} | ||
- name: Upload the patch file | ||
if: always() && steps.patch-required.outcome == 'failure' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: format-patch | ||
path: ${{ env.FORMAT_PATCH }} | ||
Lint: | ||
pre-commit: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
- name: Install Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '>=3.8' | ||
- name: Install required tools | ||
run: python -m pip install cmake-format | ||
- name: Lint CMake | ||
run: cmake-lint $(eval "${FIND_CMAKE_FILES_CMD}") | ||
python-version: 3.x | ||
- name: Run pre-commit | ||
uses: pre-commit/[email protected] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
ci: | ||
autofix_prs: false | ||
autoupdate_branch: develop | ||
|
||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v5.0.0 | ||
hooks: | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- repo: https://github.com/rhysd/actionlint | ||
rev: v1.7.6 | ||
hooks: | ||
- id: actionlint | ||
- repo: https://github.com/cheshirekow/cmake-format-precommit | ||
rev: v0.6.13 | ||
hooks: | ||
- id: cmake-format | ||
- id: cmake-format | ||
name: cmake-format (templates) | ||
types: [file] | ||
files: \.cmake\.in$ | ||
- id: cmake-lint | ||
- id: cmake-lint | ||
name: cmake-lint (templates) | ||
types: [file] | ||
files: \.cmake\.in$ | ||
- repo: https://github.com/pycqa/isort | ||
rev: 5.13.2 | ||
hooks: | ||
- id: isort | ||
- repo: https://github.com/psf/black-pre-commit-mirror | ||
rev: 24.10.0 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/csachs/pyproject-flake8 | ||
rev: v7.0.0 | ||
hooks: | ||
- id: pyproject-flake8 |
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.