-
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
84a7257
e5db202
2777866
52e2812
5569751
519f5c5
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,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 | ||
|
Contributor
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. 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 | ||
| 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 = [ | ||
|
Contributor
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.
Contributor
Author
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. Agree with all points. I added |
||
| "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*"] | ||
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.
Can you add this workflow to the README?