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.1.tar.gz (70.5 kB view details)

Uploaded Source

Built Distributions

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

Uploaded Python 3 Windows x86-64

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

Uploaded Python 3 Windows x86

fortitude_lint-0.5.1-py3-none-musllinux_1_2_x86_64.whl (2.2 MB view details)

Uploaded Python 3 musllinux: musl 1.2+ x86-64

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

Uploaded Python 3 musllinux: musl 1.2+ i686

fortitude_lint-0.5.1-py3-none-musllinux_1_2_armv7l.whl (2.0 MB view details)

Uploaded Python 3 musllinux: musl 1.2+ ARMv7l

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

Uploaded Python 3 musllinux: musl 1.2+ ARM64

fortitude_lint-0.5.1-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.1-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.1-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.1-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.1-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.1-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.1-py3-none-macosx_11_0_arm64.whl (1.9 MB view details)

Uploaded Python 3 macOS 11.0+ ARM64

fortitude_lint-0.5.1-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.1.tar.gz.

File metadata

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

File hashes

Hashes for fortitude_lint-0.5.1.tar.gz
Algorithm Hash digest
SHA256 4b16c8e4399d90a0b9a48a72edce62232fad5bd348624e78538d1e401e099352
MD5 78d2ed7389a0e616aeed50706bf63974
BLAKE2b-256 e0d70be191eab2b6244364c3f1402406fb3a5cf362b25740517a4cd9800d240f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fortitude_lint-0.5.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 b1e923141fa0a92bad3a1509949448596b91dbe920b2f253eca274f0e1ac7515
MD5 b649e18720793302d555bfe71394ffe8
BLAKE2b-256 67ea717a893b14aac084bb76595d50c5e696aa5eda4e219a286b06dc342a69b6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fortitude_lint-0.5.1-py3-none-win32.whl
Algorithm Hash digest
SHA256 97529a24271348b7202b18a2b1f9afa05ab631a8d353dc28ab3f9042bd9ff128
MD5 6e01759c8430c812f10c5be2f2a5bedc
BLAKE2b-256 8b52b80404a324a971d3952173bea316ba30bcbf437156c1502e801919192573

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fortitude_lint-0.5.1-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 c280cc826dadd80acb4506fc052756aaf8ca113e0c54efb835f91a028b274b86
MD5 cf346a059304d78d2ff03848994fb4d9
BLAKE2b-256 5846c947089ad6d7119ba112c90c2c077932fec01870c3544c5d44212a4fa9d8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fortitude_lint-0.5.1-py3-none-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 0c28db18d44585756caf8dbc98a7d999c73170c63f226694c6f8102efa17952e
MD5 0add5c2158243896dc2830f993bedf06
BLAKE2b-256 35340ac3b7870ff8ef4d642a5e7f210451a61d90503ccc0d945a1bfb96f661d0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fortitude_lint-0.5.1-py3-none-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 4dbe744f8d3d071fce8a12c74525167afe9cba6fab4e26fba78f0c525589e9aa
MD5 d91fb54b52f59c6996e514b95db76212
BLAKE2b-256 ca14d937ceaf3c8a5d06276cd6a372a1bfa4e642b7ddcc5dfbdeb3412508bfbb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fortitude_lint-0.5.1-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 e528dd5050688fc3553aabe64bc34e21222bbe940d2a808632b1023aacc324e8
MD5 dab973162f6aaa82cf97c0ee51bcd731
BLAKE2b-256 feb6d0fbf1cff666de4b6cab13d075d6605aff15a966683bbb9edf74c4cdddb2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fortitude_lint-0.5.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 530b9ffb3387a1e55eefbeecfd3b918260ab060d869d8f66ff52c8c3e3c181d3
MD5 4848543b91b73d898546255829c37238
BLAKE2b-256 0d12bd30a6d6dce9f55f11d3b33a7578f0e6f78907bf43e8230fc500b2cfa19a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fortitude_lint-0.5.1-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 11bae662bbc983aec20ea5f72a07c3d2240cec0ea3432bad0d943a958819cbd2
MD5 e254f0fef2415652b18734d68dcaec73
BLAKE2b-256 e7bcc90857cc2dec911a7b5a8aa80f4bf2c0f85dca75eb9ee78b5657481fffb3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fortitude_lint-0.5.1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 847570f2fc434fcf3fd3d7556722136f4c2caa419a9c1fd63f3cb6676674c58a
MD5 efdacdc2b6566163f70624e39b65f8d3
BLAKE2b-256 fce233f239e368cf33cbb81771d8e787b9ce9acd9f317a3d9d17e54cd4c1288e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fortitude_lint-0.5.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 ad7d9bd1b6070c62f841f7f62281dfacd30eeb0e0800a466a323101351cad74a
MD5 505c800e1853590ce5f0feb287b52c30
BLAKE2b-256 a2c519410d3fc53fab9fbadba986c0741b81f483382bc6f0542d37f9ab66f120

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fortitude_lint-0.5.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 5e3bcc5db52c30c2f36a838781066c8b7e7db320999482f9d517a6398133d147
MD5 5442ddf7835a96cfd8951a610bb169f6
BLAKE2b-256 18c0796cae7c59f72a5ac48f0ccc057be2c390c0d2fd12766f1d52ac499f1dce

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fortitude_lint-0.5.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 748f36e88d27fda52f48d33af19cab72da40511f8714c4fc0b6d1f0a5a2fa257
MD5 0ce8d21288d2f17e6723228d2ea79fa5
BLAKE2b-256 cfb6e37e699c890c1db33af9dd4d3c10f69891dc12285af476caf2dc0c908af8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fortitude_lint-0.5.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 befb327f59e18dbf564b7ad3dce03c78ab8ebd7228ba7f29f6efc8175786f3c6
MD5 a11d4206648d6b6c2feeaf8e07c9dfc4
BLAKE2b-256 07e1a899f3608e81f905bdcdca595aa2545f5ce1970c62523f2759a8e83714e0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fortitude_lint-0.5.1-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a620f5ab55bd50c7c80fc613cf5e811ccc640c6aa50173793c6abb0ecf495ee7
MD5 8abbc2a112ee8ac8217b658f649160ae
BLAKE2b-256 0d16f385e85f61196d284114aa4d575cbf2ab8a257c8710d3f72c4065822a9b7

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