Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/fortitude.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
on:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add this workflow to the README?

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fortitude 0.8.0 was released recently, and it looks like it might be worth upgrading. There are some new rules and a VS Code extension in the works


- 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.toml"
CONFIG_ARG=""
if [[ -f "$CONFIG_FILE" ]]; then
CONFIG_ARG="--config-file $CONFIG_FILE"
fi

# Run fortitude with appropriate fail behavior
fortitude $CONFIG_ARG check
14 changes: 14 additions & 0 deletions fortitude.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[check]
line-length = 120
# Core checks
select = ["E", "C", "OB", "MOD", "S", "FORT"]
# Style preferences
ignore = [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe ignore S102 as well?
S102 [*] need at least 2 spaces before inline comment
This is something that should be handled automatically by a formatter. fprettify added a rule for this recently, but it hasn't made it into a release yet.

On a related note, I think we will need to keep fprettify because Fortitude does not have the same formatting capabilities.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with all points. I added S102 to the ignore list and I have no intent to drop fprettify until/unless fortitude formatting improves.

"C003", # implicit-external-procedures: Only valid for Fortran 2018+
"C132", # default-public-accessibility
"S201", # superfluous-implicit-none
"C141", # missing-exit-or-cycle-label
"S102", # 2 space before inline comment
]
# Exclude differentiated files by pattern
exclude = ["*_b.f*", "*_d.f*"]