From 84a7257adf35bf3ad52ee1e1537bbb18665800be Mon Sep 17 00:00:00 2001 From: "Anthony V. Ozdemir" <20494900+anthony-ozdemir@users.noreply.github.com> Date: Tue, 3 Feb 2026 16:33:30 -0500 Subject: [PATCH 1/3] Add Fortitude linter workflow --- .github/workflows/fortitude.yaml | 44 ++++++++++++++++++++++++++++++++ fortitude.yaml | 14 ++++++++++ 2 files changed, 58 insertions(+) create mode 100644 .github/workflows/fortitude.yaml create mode 100644 fortitude.yaml diff --git a/.github/workflows/fortitude.yaml b/.github/workflows/fortitude.yaml new file mode 100644 index 0000000..ee5a6a1 --- /dev/null +++ b/.github/workflows/fortitude.yaml @@ -0,0 +1,44 @@ +on: + workflow_call: + inputs: + TIMEOUT: + type: number + default: 10 + description: "Timeout for the job in minutes" + +jobs: + fortitude: + runs-on: ubuntu-24.04 + timeout-minutes: ${{ inputs.TIMEOUT }} + steps: + - name: Checkout repository + uses: actions/checkout@v5 + + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: "3.11" + + - name: Install fortitude + run: pip install fortitude-lint==0.7.5 + + - name: Get fortitude config + run: | + LOCAL_CONFIG_FILE="fortitude.toml" + GLOBAL_CONFIG_URL="https://raw.githubusercontent.com/scritical/.github/main/fortitude.toml" + + if [[ ! -f "$LOCAL_CONFIG_FILE" ]]; then + echo "Downloading global fortitude config..." + wget "$GLOBAL_CONFIG_URL" -O "$LOCAL_CONFIG_FILE" || echo "No global config found, using defaults" + fi + + - name: Run fortitude + run: | + CONFIG_FILE="fortitude.yaml" + CONFIG_ARG="" + if [[ -f "$CONFIG_FILE" ]]; then + CONFIG_ARG="--config-file $CONFIG_FILE" + fi + + # Run fortitude + fortitude $CONFIG_ARG check \ No newline at end of file diff --git a/fortitude.yaml b/fortitude.yaml new file mode 100644 index 0000000..f9a84ac --- /dev/null +++ b/fortitude.yaml @@ -0,0 +1,14 @@ +[check] +line-length = 120 +# Core checks +select = ["E", "C", "OB", "MOD", "S", "FORT"] +# Style preferences +ignore = [ + "C003", # implicit-external-procedures: Only valid for Fortran 2018+ + "C132", # default-public-accessibility + "S201", # superfluous-implicit-none + "C141", # missing-exit-or-cycle-label + "C121" # use-all +] +# Exclude differentiated files by pattern +exclude = ["*_b.f*", "*_d.f*"] \ No newline at end of file From e5db2025dad99df024253592c737c2db681bf1fd Mon Sep 17 00:00:00 2001 From: Andrew Lamkin Date: Thu, 5 Feb 2026 00:04:32 +0000 Subject: [PATCH 2/3] Changing to a toml file --- fortitude.yaml => fortitude.toml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename fortitude.yaml => fortitude.toml (100%) diff --git a/fortitude.yaml b/fortitude.toml similarity index 100% rename from fortitude.yaml rename to fortitude.toml From 277786685f2bddcba2d8a22e8112c0f64d1f962d Mon Sep 17 00:00:00 2001 From: Andrew Lamkin Date: Thu, 5 Feb 2026 03:59:04 +0000 Subject: [PATCH 3/3] Adding fail option for fortitude to turn off workflow with an input switch --- .github/workflows/fortitude.yaml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/fortitude.yaml b/.github/workflows/fortitude.yaml index ee5a6a1..6700b70 100644 --- a/.github/workflows/fortitude.yaml +++ b/.github/workflows/fortitude.yaml @@ -5,6 +5,10 @@ on: type: number default: 10 description: "Timeout for the job in minutes" + FAIL: + type: boolean + default: true + description: "Fail the workflow on fortitude issues" jobs: fortitude: @@ -34,11 +38,15 @@ jobs: - name: Run fortitude run: | - CONFIG_FILE="fortitude.yaml" + CONFIG_FILE="fortitude.toml" CONFIG_ARG="" if [[ -f "$CONFIG_FILE" ]]; then CONFIG_ARG="--config-file $CONFIG_FILE" fi - # Run fortitude - fortitude $CONFIG_ARG check \ No newline at end of file + # Run fortitude with appropriate fail behavior + if [[ ${{ inputs.FAIL }} == true ]]; then + fortitude $CONFIG_ARG check + else + fortitude $CONFIG_ARG check --exit-zero + fi \ No newline at end of file