Skip to main content

A Fortran linter, written in Rust and installable with Python

Project description

Tests Clippy

Fortitude

A Fortran linter, written in Rust :crab: and installable with Python :snake:.

Table of Contents

Installation

Fortitude can be installed directly into your Python environment:

pip install fortitude-lint

It can also be installed as a pure Rust project:

git clone https://github.com/PlasmaFAIR/fortitude
cargo install --path fortitude

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 src --file-extensions=f90,fpp

You can select or ignore individual rules or whole groups with --select and --ignore:

# Just check for missing `implicit none`
fortitude check --select=T001
# Also check for missing `implicit none` in interfaces
fortitude check --select=T001,T002
# Ignore all styling rules
fortitude check --ignore=S
# Only check for typing rules, but ignore superfluous implicit none
fortitude check --select=T --ignore=T003
# Rules and categories can also be referred to by name
fortitude check --select=typing --ignore=superfluous-implicit-none

Use --output-format=concise to get shorter output:

$ fortitude check --concise
test.f90:2:1: M001 function not contained within (sub)module or program
test.f90:5:1: S061 end statement should read 'end function double'
test.f90:7:1: M001 subroutine not contained within (sub)module or program
test.f90:8:3: P021 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 T001,T011
# Print information on all style rules
fortitude explain S
# Rules and categories can also be referred to by name
fortitude explain style,superfluous-implicit-none

To see further commands and optional arguments, try using --help:

fortitude --help
fortitude check --help

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 = ["S", "T"]
ignore = ["S001", "S051"]
line-length = 132

For fpm.toml files, this has to be additionally nested under the extra.fortitude table:

[extra.fortitude.check]
select = ["S", "T"]
ignore = ["S001", "S051"]
line-length = 132

You can use --extend-select from the command line to select additional rules on top of those in the configuration file.

# Selects S, T, and M categories
fortitude check --extend-select=M

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fortitude_lint-0.5.0.tar.gz (71.0 kB view details)

Uploaded Source

Built Distributions

fortitude_lint-0.5.0-py3-none-win_amd64.whl (1.7 MB view details)

Uploaded Python 3 Windows x86-64

fortitude_lint-0.5.0-py3-none-win32.whl (1.6 MB view details)

Uploaded Python 3 Windows x86

fortitude_lint-0.5.0-py3-none-musllinux_1_2_x86_64.whl (2.1 MB view details)

Uploaded Python 3 musllinux: musl 1.2+ x86-64

fortitude_lint-0.5.0-py3-none-musllinux_1_2_i686.whl (2.1 MB view details)

Uploaded Python 3 musllinux: musl 1.2+ i686

fortitude_lint-0.5.0-py3-none-musllinux_1_2_armv7l.whl (1.9 MB view details)

Uploaded Python 3 musllinux: musl 1.2+ ARMv7l

fortitude_lint-0.5.0-py3-none-musllinux_1_2_aarch64.whl (2.0 MB view details)

Uploaded Python 3 musllinux: musl 1.2+ ARM64

fortitude_lint-0.5.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.1 MB view details)

Uploaded Python 3 manylinux: glibc 2.17+ x86-64

fortitude_lint-0.5.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl (2.3 MB view details)

Uploaded Python 3 manylinux: glibc 2.17+ s390x

fortitude_lint-0.5.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (2.2 MB view details)

Uploaded Python 3 manylinux: glibc 2.17+ ppc64le

fortitude_lint-0.5.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl (2.2 MB view details)

Uploaded Python 3 manylinux: glibc 2.17+ i686

fortitude_lint-0.5.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (2.0 MB view details)

Uploaded Python 3 manylinux: glibc 2.17+ ARMv7l

fortitude_lint-0.5.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.0 MB view details)

Uploaded Python 3 manylinux: glibc 2.17+ ARM64

fortitude_lint-0.5.0-py3-none-macosx_11_0_arm64.whl (1.9 MB view details)

Uploaded Python 3 macOS 11.0+ ARM64

fortitude_lint-0.5.0-py3-none-macosx_10_12_x86_64.whl (2.0 MB view details)

Uploaded Python 3 macOS 10.12+ x86-64

File details

Details for the file fortitude_lint-0.5.0.tar.gz.

File metadata

  • Download URL: fortitude_lint-0.5.0.tar.gz
  • Upload date:
  • Size: 71.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.7.4

File hashes

Hashes for fortitude_lint-0.5.0.tar.gz
Algorithm Hash digest
SHA256 32ddff1a26310d6702f007c623764048284400a92f203dc721310f7f050bdc9e
MD5 c12b120381f06fb5307cf0030e419a48
BLAKE2b-256 9c235d27fecffb7999f8c924c4530ba274960f4a485cbe1a9e755d976d6899ac

See more details on using hashes here.

File details

Details for the file fortitude_lint-0.5.0-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for fortitude_lint-0.5.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 a455e8a759369162d1d7aef84dbd90e7b9f655d81ee3125a9720bd5a49626f8e
MD5 b6cbf8d1e6198a1bea128a527b88b738
BLAKE2b-256 80e230e4c847ee48c97d7c1a7cc3d67f4bea2c1f01e6d824f4d6bc784108a868

See more details on using hashes here.

File details

Details for the file fortitude_lint-0.5.0-py3-none-win32.whl.

File metadata

File hashes

Hashes for fortitude_lint-0.5.0-py3-none-win32.whl
Algorithm Hash digest
SHA256 8bbc827604839f24634dac57dd496a9a4cae6d4e021b056793f57f319e8c6638
MD5 4b13b1a092d4d56f7f423fc6861156e1
BLAKE2b-256 5c8585998db99dcaf2630c12cf42a32e0056629a019d67c81a255513804e40c2

See more details on using hashes here.

File details

Details for the file fortitude_lint-0.5.0-py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for fortitude_lint-0.5.0-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 fc1da8106a6a5fbd1969df4097ba4276734ba8c7bb2fcf638162f2278a9ec396
MD5 5e98ea64b697c3e8e0191a8ed37b0427
BLAKE2b-256 53e664b37ba3f017a77cae534ba6c8c8185c9e56c2e6bee5005c1bae369dee60

See more details on using hashes here.

File details

Details for the file fortitude_lint-0.5.0-py3-none-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for fortitude_lint-0.5.0-py3-none-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 ced3750ec5c6acdacd85ff8ab4686561308444b59aa24f071d412477e2d911a8
MD5 1bd2b7450f579afc578227806bee9b44
BLAKE2b-256 33c351d060933a8cf6da0b6860e726cad800d0589b620d8d947a637e2045c3db

See more details on using hashes here.

File details

Details for the file fortitude_lint-0.5.0-py3-none-musllinux_1_2_armv7l.whl.

File metadata

File hashes

Hashes for fortitude_lint-0.5.0-py3-none-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 009d68d307984fd21088a9511d2a434cb3f80130df27c286c892fa9ecbb58402
MD5 3b1fde67f6dee7879499df120800d78d
BLAKE2b-256 b213d09329f84709b62d0e8fb67b35acd70dc3c09a03571dd5c15143b5867c05

See more details on using hashes here.

File details

Details for the file fortitude_lint-0.5.0-py3-none-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for fortitude_lint-0.5.0-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 7dff261966ab2aa637bf3a6b94423e4a27edf37fd64fe9ad8b94499df245b5aa
MD5 1ed34f6300ad29a3bc7d1da83fac5dae
BLAKE2b-256 9004225e68b7bbfd9fa50d23ac39a7e658887dacbd6ea47355fd80da1dbda09e

See more details on using hashes here.

File details

Details for the file fortitude_lint-0.5.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fortitude_lint-0.5.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 abc3c21826984bc5e6c644ba0241a5f4e8c61a603dd33baf4507c86fae8ab904
MD5 8f53299e1a8c5efd4896a02e23b19093
BLAKE2b-256 c503e2974ccad009767c2386b89fb4bb96ddc2b94c0f3c0073cfb75b1b57801b

See more details on using hashes here.

File details

Details for the file fortitude_lint-0.5.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl.

File metadata

File hashes

Hashes for fortitude_lint-0.5.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 7dd86d534d9bc86d30c62f2fe48fe0e3c7e8ee5c44acd3abce3a8eadf222cf7c
MD5 e1ebf19edd7e487c30cd9a27d70c14f5
BLAKE2b-256 2b79da6399277c29ee97cd7e66c5e76301d4b9d34474d4b7a63c501298949b56

See more details on using hashes here.

File details

Details for the file fortitude_lint-0.5.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for fortitude_lint-0.5.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 ee3955cf2e5efb96a08b1c467cfd454fd30abe2ab06fbe07d5f0ff1f0b98d3ba
MD5 001783827008210bb9edc46cb8fc6511
BLAKE2b-256 ea33970b294002fed442dc1618e7700dd8fc3b2683132bee30be0c89588bc037

See more details on using hashes here.

File details

Details for the file fortitude_lint-0.5.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for fortitude_lint-0.5.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 5a76560ca96aa840500ec6af4e6546f8672f2ab46ac344cd6cdd436740b6d7b1
MD5 2c7e2f35cc5359f4a05ddc113410d29d
BLAKE2b-256 4de662e21fc2b2f0f96b51ee15a5beac6a5f737805c5ce2b68de2dd570526cd6

See more details on using hashes here.

File details

Details for the file fortitude_lint-0.5.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for fortitude_lint-0.5.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 267498ef4f206c509c4f0038bc46b043c197c5b843cffa01b5366eacb68ed9b6
MD5 3044552d1c5d130c4f146ad8ee8a6b50
BLAKE2b-256 5164ef16d5d94102099d8909f60008a1fece7219c704839a9e13f7883241d8ce

See more details on using hashes here.

File details

Details for the file fortitude_lint-0.5.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for fortitude_lint-0.5.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 1e0121d12f974ae6549db5de8ce1bd6893749e2529078d23971ea3dddabe54ec
MD5 bf93421e6e799acb929f1cde59063434
BLAKE2b-256 8f8a39d275459c5871c19f370d4d90b557ed90db972482dffabe5d04d6e1fffd

See more details on using hashes here.

File details

Details for the file fortitude_lint-0.5.0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fortitude_lint-0.5.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 630c34c089890eccb885eb605b630b9e886d9f31d6e46bceba8c161400577bf9
MD5 1249f96b72d5b59bbd4e7c2936bc8349
BLAKE2b-256 5f81bbdc3d6f4476435373f5a3c34bb93e56d98aeabfa7f3c25ffe56c79d7319

See more details on using hashes here.

File details

Details for the file fortitude_lint-0.5.0-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for fortitude_lint-0.5.0-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 1e2f6e04c994e2f36b6294b5bdf49df92ba4bae1494df27267e9bc841e3b06db
MD5 68537c2d1b1f4b4ea0091f4af04ffb14
BLAKE2b-256 1d86c60c36af598b86b96886608da7af73fc4cc10625c7cb985ef9a653191bd0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page