-
Notifications
You must be signed in to change notification settings - Fork 0
Feature fortitude lint #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| TIMEOUT: | ||
| 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: | ||
| 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.toml" | ||
| CONFIG_ARG="" | ||
| if [[ -f "$CONFIG_FILE" ]]; then | ||
| CONFIG_ARG="--config-file $CONFIG_FILE" | ||
| fi | ||
|
|
||
| # Run fortitude with appropriate fail behavior | ||
| if [[ ${{ inputs.FAIL }} == true ]]; then | ||
| fortitude $CONFIG_ARG check | ||
| else | ||
| fortitude $CONFIG_ARG check --exit-zero | ||
| fi | ||
| 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 = [ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe ignore S102 as well? On a related note, I think we will need to keep fprettify because Fortitude does not have the same formatting capabilities. |
||
| "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 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should enable C121 so we have explicit |
||
| ] | ||
| # Exclude differentiated files by pattern | ||
| exclude = ["*_b.f*", "*_d.f*"] | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be an on/off flag instead?