Settings
Top-level
include
A list of file patterns to include when linting.
Inclusion are based on globs, and should be single-path patterns, like
*.f90, to include any file with the .f90 extension.
For more information on the glob syntax, refer to the globset documentation.
Introduced in 0.8.0
Default value: ["*.f90", "*.F90", "*.f95", "*.F95", "*.f03", "*.F03", "*.f08", "*.F08", "*.f18", "*.F18", "*.f23", "*.F23", "*.pf"]
Type: list[str]
Example usage:
check
Configures how Fortitude checks your code.
Options specified in the check section take precedence over the deprecated top-level settings.
exclude
A list of file patterns to exclude from formatting and linting.
Exclusions are based on globs, and can be either:
- Single-path patterns, like
build(to exclude any directory namedbuildin the tree),foo.f90(to exclude any file namedfoo.f90), orfoo_*.f90(to exclude any file matchingfoo_*.f90). - Relative patterns, like
directory/foo.f90(to exclude that specific file) ordirectory/*.f90(to exclude any Fortran files indirectory). Note that these paths are relative to the project root (e.g., the directory containing yourfpm.toml).
For more information on the glob syntax, refer to the globset documentation.
Note that you'll typically want to use
extend-exclude to modify the excluded paths.
Default value: [".git", ".git-rewrite", ".hg", ".svn", "venv", ".venv", "pyenv", ".pyenv", ".eggs", "site-packages", ".vscode", "build", "_build", "dist", "_dist"]
Type: list[str]
Example usage:
extend-exclude
A list of file patterns to omit from formatting and linting, in addition to those
specified by exclude.
Exclusions are based on globs, and can be either:
- Single-path patterns, like
build(to exclude any directory namedbuildin the tree),foo.f90(to exclude any file namedfoo.f90), orfoo_*.f90(to exclude any file matchingfoo_*.f90). - Relative patterns, like
directory/foo.f90(to exclude that specific file) ordirectory/*.f90(to exclude any Fortran files indirectory). Note that these paths are relative to the project root (e.g., the directory containing yourfpm.toml).
For more information on the glob syntax, refer to the globset documentation.
Default value: []
Type: list[str]
Example usage:
extend-fixable
A list of rule codes or prefixes to consider fixable, in addition to those
specified by fixable.
Default value: []
Type: list[RuleSelector]
Example usage:
extend-select
A list of rule codes or prefixes to enable, in addition to those
specified by select.
Default value: []
Type: list[RuleSelector]
Example usage:
file-extensions
Deprecated
This option has been deprecated in 0.8.0. The file_extensions option is now deprecated in favour of the top-level include. Please update your configuration to use the include instead.
A list of file extensions to check
Default value: ["f90", "F90", "f95", "F95", "f03", "F03", "f08", "F08", "f18", "F18", "f23", "F23", "pf"]
Type: list[str]
Example usage:
files
Deprecated
This option has been deprecated in 0.8.0. The files option is now deprecated in favour of the top-level include. Please update your configuration to use the include instead.
A list of file patterns to include when linting.
Inclusion are based on globs, and should be single-path patterns, like
*.f90, to include any file with the .f90 extension.
For more information on the glob syntax, refer to the globset documentation.
Default value: ["."]
Type: list[str]
Example usage:
fix
Enable fix behavior by-default when running fortitude (overridden
by the --fix and --no-fix command-line flags).
Only includes automatic fixes unless --unsafe-fixes is provided.
Default value: false
Type: bool
Example usage:
fix-only
Like fix, but disables reporting on leftover violation. Implies fix.
Default value: false
Type: bool
Example usage:
fixable
A list of rule codes or prefixes to consider fixable. By default, all rules are considered fixable.
Default value: ["ALL"]
Type: list[RuleSelector]
Example usage:
force-exclude
Whether to enforce exclude and extend-exclude patterns,
even for paths that are passed to Fortitude explicitly. Typically, Fortitude will lint
any paths passed in directly, even if they would typically be
excluded. Setting force-exclude = true will cause Fortitude to
respect these exclusions unequivocally.
This is useful for CI jobs which might explicitly pass all changed files, regardless of whether they're marked as excluded by Fortitude's own settings.
Default value: false
Type: bool
Example usage:
ignore
A list of rule codes or prefixes to ignore. Prefixes can specify exact
rules (like S201 or superfluous-implicit-none), entire categories
(like C or correctness), or anything in between.
When breaking ties between enabled and disabled rules (via select and
ignore, respectively), more specific prefixes override less
specific prefixes.
Default value: []
Type: list[RuleSelector]
Example usage:
ignore-comment-length
By default disable ignore-comment-length behavior when running fortitude.
Default value: false
Type: bool
Example usage:
line-length
The line length to use when enforcing long-lines violations (like S001).
The length is determined by the number of characters per line, except for lines containing East Asian characters or emojis. For these lines, the unicode width of each character is added up to determine the length.
Default value: 100
Type: int
Example usage:
output-format
The style in which violation messages should be formatted: "full" (default)
(shows source), "concise", "grouped" (group messages by file), "json"
(machine-readable), "junit" (machine-readable XML), "github" (GitHub
Actions annotations), "gitlab" (GitLab CI code quality report),
"pylint" (Pylint text format) or "azure" (Azure Pipeline logging commands).
Default value: "full"
Type: "full" | "concise" | "grouped" | "json" | "junit" | "github" | "gitlab" | "pylint" | "azure"
Example usage:
per-file-ignores
A list of mappings from file pattern to rule codes or prefixes to exclude, when considering any matching files. An initial '!' negates the file pattern.
Default value: {}
Type: dict[str, list[RuleSelector]]
Example usage:
preview
Whether to enable preview mode. When preview mode is enabled, Fortitude will use unstable rules, fixes, and formatting.
Default value: false
Type: bool
Example usage:
progress-bar
Progress bar settings. Options are "off" (default), "ascii", and "fancy"
Default value: off
Type: str
Example usage:
respect-gitignore
Whether to automatically exclude files that are ignored by .ignore,
.gitignore, .git/info/exclude, and global gitignore files.
Enabled by default.
Default value: true
Type: bool
Example usage:
select
A list of rule codes or prefixes to enable. Prefixes can specify exact
rules (like S201 or superfluous-implicit-none), entire categories
(like C or correctness), or anything in between.
By default, a curated set of rules across all categories is enabled; see the documentation for details.
When breaking ties between enabled and disabled rules (via select and
ignore, respectively), more specific prefixes override less
specific prefixes.
Default value: []
Type: list[RuleSelector]
Example usage:
show-fixes
Whether to show an enumeration of all fixed lint violations
(overridden by the --show-fixes command-line flag).
Default value: false
Type: bool
Example usage:
target-std
Minimum Fortran standard to check files against. Options are "f2023", "f2018" (default), "f2008", "f2003", and "f95".
Default value: f2018
Type: "f2023" | "f2018" | "f2008" | "f2003" | "f95"
Example usage:
unfixable
A list of rule codes or prefixes to consider non-fixable.
Default value: []
Type: list[RuleSelector]
Example usage:
unsafe-fixes
Enable application of unsafe fixes. If excluded, a hint will be displayed when unsafe fixes are available. If set to false, the hint will be hidden.
Default value: null
Type: bool
Example usage:
check.complexity
Options for too-complex rule
max-args
The maximum number of arguments allowed for a procedure. Procedures exceeding this threshold will be flagged.
Default value: 5
Type: usize
Example usage:
max-complexity
The maximum cyclomatic complexity allowed for a procedure. Procedures exceeding this threshold will be flagged.
Default value: 10
Type: usize
Example usage:
check.exit-unlabelled-loops
Options for the exit-or-cycle-in-unlabelled-loops rule
allow-unnested-loops
Whether to check for exit/cycle in unlabelled loops only if the loop has at
least one level of nesting. With this setting off (default), the following will
raise a warning, and with it on, it won't:
Default value: false
Type: bool
Example usage:
check.inconsistent-dimensions
Options for inconsistent-dimension set of rules
prefer-attribute
Prefer declaring arrays using the dimension attribute rather than an
inline shape, foo(N, M) or vice-versa.
Default behaviour is to keep the current method.
Default value: keep
Type: "keep" | "always" | "never"
Example usage:
check.incorrect-keyword-case
Options for the incorrect-keyword-case rule
keyword-case
Preferred casing for Fortran keywords, as enforced by the incorrect-keyword-case rule.
Defaults to "lowercase", consistent with modern Fortran conventions.
Default value: lowercase
Type: "lowercase" | "uppercase" | "titlecase"
Example usage:
check.invalid-tab
Options for invalid-tab rule
indent-width
The number of spaces to replace tabs with.
Default value: 4
Type: int
Example usage:
check.keyword-whitespace
Options for the keyword-missing-space and keyword-has-whitespace rules
goto-with-space
Whether to enforce the use of go to instead of goto.
Default value: false
Type: bool
Example usage:
inout-with-space
Whether to enforce the use of in out instead of inout.
Default value: false
Type: bool
Example usage:
check.line-too-long
Options for line-too-long rule
ignore-comments
If true, don't take comments into account when checking if a line is
too long. This can be useful when dealing with existing codebases with
long comments, for instance, or inline comments used for other tools.
Default value: false
Type: bool
Example usage:
check.portability
Options for the portability rules
allow-cray-file-units
Whether to allow file units of 100, 101, 102 in read/write statements
for non-portable-io-unit. The Cray
compiler pre-connects these to stdin, stdout, and stderr,
respectively. However, if you are open-ing these units explicitly, you may
wish to switch this to true -- but see also
magic-io-unit.
Default value: false
Type: bool
Example usage:
check.shadowed-variables
Options for the shadowed-variable rule
allow
A list of variable names that are allowed to be shadowed. By default, common loop variables and error flags are allowed to be shadowed.
Default value: ["i", "j", "k", "l", "m", "n", "ii", "jj", "kk", "ll", "mm", "nn", "idx", "index", "err", "ierr", "ioerr", "ios", "info", "stat", "iostat", "istat", "status"]
Type: list[str]
Example usage:
strict
Strict mode will also check dummy arguments for violations
Default value: false
Type: bool
Example usage:
check.strings
Options for the string literal rules
quotes
Quote style to prefer for string literals (either "single" or "double").
Default value: "double"
Type: "single" | "double"
Example usage:
check.use-statements
Options for the use statement rules
allow-bare-use
List of exceptions to the use-all rule. That is, modules allowed to
appear in a use statement without an only clause.
While it is recommended to list all used components in an only clause, this can
occasionally be impractical for some modules. For example, if the only list would
commonly be very long, or would often list all or nearly all of the module's contents.
Note that this option is intended for modules that are safe to use without an only
clause across the whole codebase. For one-off instances, consider inline error
suppression comments such as ! allow(use-all) instead.
Default value: []
Type: list[str]
Example usage: