A Fortran linter, written in Rust and installable with Python
Project description
Fortitude
A Fortran linter, inspired by (and built upon) Ruff. Written in Rust :crab: and installable with Python :snake:.
- :zap: Blazingly fast, up to hundreds of times faster than other open-source Fortran linters.
- :wrench: Automatically fixes linter warnings.
- :chart_with_upwards_trend: 50+ rules, with many more planned.
- :page_with_curl: Multiple output formats, including SARIF and GitHub/GitLab CI.
- :handshake: Follows community best practices.
- :muscle: Built on a robust tree-sitter parser.
Table of Contents
Installation
Fortitude is available as
fortitude-lint on PyPI:
# With uv:
uv tool install fortitude-lint@latest
# With pip:
pip install fortitude-lint
Starting with version 0.7.0, Fortitude can be installed with our
standalone installers:
# On macOS and Linux:
curl -LsSf https://github.com/PlasmaFAIR/fortitude/releases/latest/download/fortitude-installer.sh | sh
# On Windows:
powershell -c "irm https://github.com/PlasmaFAIR/fortitude/releases/latest/download/fortitude-installer.psi | iex"
It can also be installed as a pure Rust project:
git clone https://github.com/PlasmaFAIR/fortitude
cd fortitude
cargo install --path fortitude
Fortitude can also be installed via other package managers
Usage
Fortitude can lint your whole project under the working directory
using the check command:
fortitude check
You can also call check on individual files, globs, and
directories. You can configure what extensions Fortitude searches
for in directories with --file-extensions:
fortitude check --file-extensions=f90,fpp
Be default, Fortitude will ignore files and directories in your .gitignore.
This can be disabled by setting --no-respect-gitignore. Additional excludes
can be set using --excludes:
# Don't check in the `benchmarks/` and `tests/` directories.
fortitude check --exclude=benchmarks,tests
You can select or ignore individual rules or whole groups with
--select and --ignore:
# Just check for missing `implicit none`
fortitude check --select=C001
# Also check for missing `implicit none` in interfaces
fortitude check --select=C001,C002
# Ignore all styling rules
fortitude check --ignore=S
# Only check for style rules, but ignore superfluous implicit none
fortitude check --select=S --ignore=S201
# Rules and categories can also be referred to by name
fortitude check --select=style --ignore=superfluous-implicit-none
Use --output-format=concise to get shorter output:
$ fortitude check --output-format=concise
test.f90:2:1: C111 function not contained within (sub)module or program
test.f90:5:1: S061 end statement should read 'end function double'
test.f90:7:1: C111 subroutine not contained within (sub)module or program
test.f90:8:3: C022 real has implicit kind
The explain command can be used to get extra information about any rules:
# Print extra information for all rules
fortitude explain
# Only get information for selected rules
fortitude explain C001 C011
# Print information on all style rules
fortitude explain S
# Rules and categories can also be referred to by name
fortitude explain obsolescent superfluous-implicit-none
To see further commands and optional arguments, try using --help:
fortitude --help
fortitude check --help
Fixes
[!NOTE] Added in v0.6.0
Fortitude can automatically fix some lint warnings, such as
unnecessary implicit none statements, missing double-colons in
variable declarations, and more. Just pass the --fix flag to
check:
$ fortitude check --fix
fortitude: 1 files scanned.
Number of errors: 2 (2 fixed, 0 remaining)
Run fortitude explain to see which rules have fixes available.
Preview
[!NOTE] Added in v0.6.0
Some fortitude rules are only available through an opt-in preview
mode to give the community some time to evaluate them and provide
feedback. To enable preview rules, pass the --preview flag to
check,
$ fortitude check --preview
or to enable more permanently, set it in your fpm.toml:
[extra.fortitude.check]
preview = true
or fortitude.toml:
[check]
preview = true
Run fortitude explain to see which rules are in preview mode.
Configuration
Fortitude will look for either a fortitude.toml or fpm.toml file in the
current directory, or one of its parents. If using fortitude.toml, settings
should be under the command name:
[check]
select = ["C", "E", "S"]
ignore = ["S001", "S082"]
line-length = 132
For fpm.toml files, this has to be additionally nested under the
extra.fortitude table:
[extra.fortitude.check]
select = ["C", "E", "S"]
ignore = ["S001", "S082"]
line-length = 132
You can use --extend-select from the command line to select additional
rules on top of those in the configuration file.
# Select correctness, error, style and obsolescent categories
fortitude check --extend-select=OB
pre-commit
Pre-commit hooks for Fortitude are available at fortitude-pre-commit.
Documentation
See table of rules for a list of all rules.
Contributing
Please feel free to add or suggest new rules or comment on the layout of the project
while it's still at this early stage of development. See
CONTRIBUTING.md for a guide on contributing to the project, and
README.dev.md for details on building the project from source,
running tests, and linting/formatting the code. Please consult our code of
conduct before contributing.
License
This work is distributed under the MIT License. See LICENSE for more
information.
Fortitude is inspired by, and uses parts from
ruff, used under the MIT licence. See
LICENSE for more information.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fortitude_lint-0.7.5.tar.gz.
File metadata
- Download URL: fortitude_lint-0.7.5.tar.gz
- Upload date:
- Size: 168.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.8.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a0c6d38a6444fbe31d1724c14672181a264e48d755629b757e9b10c688685d9
|
|
| MD5 |
a8a4fe0859de6f4043a9d9468da34e21
|
|
| BLAKE2b-256 |
64c6302ba32b7a847aa7b79d169b585909e55408762b7c8916550c64ad9d4222
|
File details
Details for the file fortitude_lint-0.7.5-py3-none-win_arm64.whl.
File metadata
- Download URL: fortitude_lint-0.7.5-py3-none-win_arm64.whl
- Upload date:
- Size: 2.7 MB
- Tags: Python 3, Windows ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.8.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5766a2c26aa5bc008d63f8d1e79392adfee94ef8cc1bbaca1aad9a2ba7db4548
|
|
| MD5 |
8ff0a510d772fea4b89ad372ef0b1fb2
|
|
| BLAKE2b-256 |
3fdcc0625ffd4d827d9da57de5f88decc4a0c95235f872eef1037d3cfa28fdc2
|
File details
Details for the file fortitude_lint-0.7.5-py3-none-win_amd64.whl.
File metadata
- Download URL: fortitude_lint-0.7.5-py3-none-win_amd64.whl
- Upload date:
- Size: 2.8 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.8.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b03539fcb804f240b426b23dc759635dae9417dd4a363d74eb001a28fbf7fb2f
|
|
| MD5 |
5728b00f8c652d4c84c2a8a2bdb02377
|
|
| BLAKE2b-256 |
4fa29be916b8f0da17da6b0b6d2ca2cb18996a10847ac080196f5ce6aa97a2fd
|
File details
Details for the file fortitude_lint-0.7.5-py3-none-win32.whl.
File metadata
- Download URL: fortitude_lint-0.7.5-py3-none-win32.whl
- Upload date:
- Size: 2.6 MB
- Tags: Python 3, Windows x86
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.8.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ced135143ce087a7b3859152ae1069be448eb7f22d64dfebf9cd3d7554d7f6a
|
|
| MD5 |
cf0af9d5ec314eba6f59a24cb867bab7
|
|
| BLAKE2b-256 |
24d656acede6a71841560c56bc7d23e9dc32d931c57a3ed0dc5cb64be30b9b78
|
File details
Details for the file fortitude_lint-0.7.5-py3-none-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: fortitude_lint-0.7.5-py3-none-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 3.0 MB
- Tags: Python 3, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.8.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44a3e762b5b561b5a9f91aa2f6cd4fe60e7814b25d4f0d635b9397311b49d920
|
|
| MD5 |
41d94088f5c06b8118740fbc11fa5197
|
|
| BLAKE2b-256 |
9f2d620db4009a83dd29b18b6902e8862c5d8172d96f09c84460cf3736e839f1
|
File details
Details for the file fortitude_lint-0.7.5-py3-none-musllinux_1_2_i686.whl.
File metadata
- Download URL: fortitude_lint-0.7.5-py3-none-musllinux_1_2_i686.whl
- Upload date:
- Size: 3.0 MB
- Tags: Python 3, musllinux: musl 1.2+ i686
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.8.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
896cb9edb5a81bfb1c16889b72167ac363b2260e3e980ecfb32310705e8eef5b
|
|
| MD5 |
6040c94fabea96df30e4942d71e1301a
|
|
| BLAKE2b-256 |
f3e7d85f5627adadcc5e8228b21cd114de5306f0a2e2dff2f57d3c12d5408fd0
|
File details
Details for the file fortitude_lint-0.7.5-py3-none-musllinux_1_2_armv7l.whl.
File metadata
- Download URL: fortitude_lint-0.7.5-py3-none-musllinux_1_2_armv7l.whl
- Upload date:
- Size: 2.6 MB
- Tags: Python 3, musllinux: musl 1.2+ ARMv7l
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.8.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6c0e90dbff55f5ad0a353fa608621df48568e97aa6954b8f640ac5f9a7e5cc9
|
|
| MD5 |
66a9228cb99edaa6173383a0ba5844f8
|
|
| BLAKE2b-256 |
7bb584dc4ae7de32181d2f819d117de900a68a92a18afeb05cd07684c2105f18
|
File details
Details for the file fortitude_lint-0.7.5-py3-none-musllinux_1_2_aarch64.whl.
File metadata
- Download URL: fortitude_lint-0.7.5-py3-none-musllinux_1_2_aarch64.whl
- Upload date:
- Size: 2.7 MB
- Tags: Python 3, musllinux: musl 1.2+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.8.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fce8ba427e52f013b4d6ab67ab79eb331c18c63b510c6020283cf216b2d5f440
|
|
| MD5 |
0c5db5f025c004dfe8905f3f7989feb9
|
|
| BLAKE2b-256 |
6396e85d934685fea551574c6cc4d7f2e2fc46980122769bb9479cd46b115c4f
|
File details
Details for the file fortitude_lint-0.7.5-py3-none-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: fortitude_lint-0.7.5-py3-none-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 3.0 MB
- Tags: Python 3, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.8.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
14a6ef16e7e317e89e608187df2b752c8b5b45b2788516f2353f8b1d787041cd
|
|
| MD5 |
319d446ad9e4f75bd426c6f080bcf37b
|
|
| BLAKE2b-256 |
4bb41685e75a26efb32f0f773debdb06c15cf59dfd0f0f560de3e54afdf4f077
|
File details
Details for the file fortitude_lint-0.7.5-py3-none-manylinux_2_28_s390x.whl.
File metadata
- Download URL: fortitude_lint-0.7.5-py3-none-manylinux_2_28_s390x.whl
- Upload date:
- Size: 3.0 MB
- Tags: Python 3, manylinux: glibc 2.28+ s390x
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.8.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d2e557c9a22de85d380e43ab9edb29c93e4a15d8dbd2ff41695f1e61cd5c27b
|
|
| MD5 |
3025c6825c60a9fc071811a4318724c5
|
|
| BLAKE2b-256 |
031dafbee8b15115baa6e9a1b8c62fd535f3e8c1eafe9f0e2f3858a62390ccca
|
File details
Details for the file fortitude_lint-0.7.5-py3-none-manylinux_2_28_ppc64le.whl.
File metadata
- Download URL: fortitude_lint-0.7.5-py3-none-manylinux_2_28_ppc64le.whl
- Upload date:
- Size: 3.3 MB
- Tags: Python 3, manylinux: glibc 2.28+ ppc64le
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.8.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cbef4aacb376f36c5771269ed28c6d69317725ea09098784a0744bee200291ea
|
|
| MD5 |
3d603a7d8833450915590b2a15b8de40
|
|
| BLAKE2b-256 |
ec83afdbeb6e261ba4d942758a99863ee51ab356e87f88b95922d389c11fb665
|
File details
Details for the file fortitude_lint-0.7.5-py3-none-manylinux_2_28_i686.whl.
File metadata
- Download URL: fortitude_lint-0.7.5-py3-none-manylinux_2_28_i686.whl
- Upload date:
- Size: 3.1 MB
- Tags: Python 3, manylinux: glibc 2.28+ i686
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.8.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77d155a6879e13884b517134bc3ef3f75882b428821b053e8e85716c38ea095c
|
|
| MD5 |
6e487dde161a82c41c65e048298529e5
|
|
| BLAKE2b-256 |
31c7fc918b3bb3ae8c3152782669cd2808b525726c41e533ce6151ec19f8c8e5
|
File details
Details for the file fortitude_lint-0.7.5-py3-none-manylinux_2_28_armv7l.whl.
File metadata
- Download URL: fortitude_lint-0.7.5-py3-none-manylinux_2_28_armv7l.whl
- Upload date:
- Size: 2.6 MB
- Tags: Python 3, manylinux: glibc 2.28+ ARMv7l
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.8.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c692c0b95334c1cc3c327d1fb56fd7ae15254ae9c0d94629c285fc096005b96
|
|
| MD5 |
ea3a353e19d52de7322c88fe3b211e17
|
|
| BLAKE2b-256 |
7c45a04c26d73664a733cd3d1aac63489f24bab17b333d7c08d3936d0e2d8ef4
|
File details
Details for the file fortitude_lint-0.7.5-py3-none-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: fortitude_lint-0.7.5-py3-none-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 2.7 MB
- Tags: Python 3, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.8.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61aeb00b4324b2b2191a6b73c574ccdc5faf409f8efdb7ae1199a79a71039b86
|
|
| MD5 |
c1f3e5e12d2b06afc7f7be208e52c387
|
|
| BLAKE2b-256 |
12765cc7b280dfce3a9fc6a08d03abafa52d8b4e3dc87ee61e518fbb17c8423f
|
File details
Details for the file fortitude_lint-0.7.5-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: fortitude_lint-0.7.5-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.8 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.8.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b323599be8074c1340866b56e8a758f8dccadc11e0d97d5eb12b472c582e9393
|
|
| MD5 |
380c4e19d9def5fa3c105ea54a8859b0
|
|
| BLAKE2b-256 |
0c91933444d1532566761e0f69c0cbe71465a5798fb1179a34196b77cdadfc25
|
File details
Details for the file fortitude_lint-0.7.5-py3-none-macosx_10_12_x86_64.whl.
File metadata
- Download URL: fortitude_lint-0.7.5-py3-none-macosx_10_12_x86_64.whl
- Upload date:
- Size: 2.8 MB
- Tags: Python 3, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.8.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a45422fce15e6fec7f9e4b196515dced704b3f83c176ebb00a2d2b62c14399f
|
|
| MD5 |
80f8e6385c3c2c47e565c3d4011d8acd
|
|
| BLAKE2b-256 |
1f61d7f7d5fbc340e7aafcb6bb27baba771ed14087b444d781860fd713d6252b
|