-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #210 from PlasmaFAIR/dev-command
Add basic docs
- Loading branch information
Showing
58 changed files
with
1,824 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[alias] | ||
dev = "run --package fortitude_dev --bin fortitude_dev" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
version: 2 | ||
|
||
build: | ||
os: ubuntu-24.04 | ||
tools: | ||
python: "3" | ||
|
||
python: | ||
install: | ||
- requirements: requirements.docs.txt | ||
|
||
mkdocs: | ||
configuration: mkdocs.yml |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
# 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, while for | ||
`fpm.toml` files, this has to be additionally nested under the | ||
`extra.fortitude` table: | ||
|
||
|
||
=== "fortitude.toml" | ||
|
||
```toml | ||
[check] | ||
select = ["S", "T"] | ||
ignore = ["S001", "S051"] | ||
line-length = 132 | ||
``` | ||
=== "fpm.toml" | ||
|
||
```toml | ||
[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. | ||
|
||
```bash | ||
# Selects S, T, and M categories | ||
fortitude check --extend-select=M | ||
``` | ||
|
||
## Full command-line interface | ||
|
||
See `fortitude help` for the full list of Fortitude's top-level commands: | ||
|
||
<!-- Begin auto-generated command help. --> | ||
|
||
```text | ||
A Fortran linter, written in Rust and installable with Python | ||
Usage: fortitude [OPTIONS] <COMMAND> | ||
Commands: | ||
check Perform static analysis on files and report issues | ||
explain Get descriptions, rationales, and solutions for each rule | ||
help Print this message or the help of the given subcommand(s) | ||
Options: | ||
--config-file <CONFIG_FILE> Path to a TOML configuration file | ||
-h, --help Print help | ||
-V, --version Print version | ||
``` | ||
|
||
<!-- End auto-generated command help. --> | ||
|
||
Or `fortitude help check` for more on the linting command: | ||
|
||
<!-- Begin auto-generated check help. --> | ||
|
||
```text | ||
Perform static analysis on files and report issues | ||
Usage: fortitude check [OPTIONS] [FILES]... | ||
Arguments: | ||
[FILES]... List of files or directories to check. Directories are searched recursively for Fortran files. The `--file-extensions` option can be used to control which files are included in the search [default: .] | ||
Options: | ||
--line-length <LINE_LENGTH> | ||
Set the maximum allowable line length [default: 100] | ||
--file-extensions <FILE_EXTENSIONS> | ||
File extensions to check [default: f90 F90 f95 F95 f03 F03 f08 F08 f18 F18 f23 F23] | ||
--fix | ||
Apply fixes to resolve lint violations. Use `--no-fix` to disable or `--unsafe-fixes` to include unsafe fixes | ||
--unsafe-fixes | ||
Include fixes that may not retain the original intent of the code. Use `--no-unsafe-fixes` to disable | ||
--show-fixes | ||
Show an enumeration of all fixed lint violations. Use `--no-show-fixes` to disable | ||
--fix-only | ||
Apply fixes to resolve lint violations, but don't report on, or exit non-zero for, leftover violations. Implies `--fix`. Use `--no-fix-only` to disable or `--unsafe-fixes` to include unsafe fixes | ||
--output-format <OUTPUT_FORMAT> | ||
Output serialization format for violations. The default serialization format is "full" [env: FORTITUDE_OUTPUT_FORMAT=] [possible values: concise, full, json, json-lines, junit, grouped, github, gitlab, pylint, rdjson, azure, sarif] | ||
--preview | ||
Enable preview mode; checks will include unstable rules and fixes. Use `--no-preview` to disable | ||
--progress-bar <PROGRESS_BAR> | ||
Progress bar settings. Options are "off" (default), "ascii", and "fancy" [possible values: off, fancy, ascii] | ||
-h, --help | ||
Print help | ||
Rule selection: | ||
--ignore <RULE_CODE> | ||
Comma-separated list of rules to ignore | ||
--select <RULE_CODE> | ||
Comma-separated list of rule codes to enable (or ALL, to enable all rules) | ||
--extend-select <RULE_CODE> | ||
Like --select, but adds additional rule codes on top of those already specified | ||
``` | ||
|
||
<!-- End auto-generated check help. --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# FAQ | ||
|
||
## Does fortitude handle preprocessor files? | ||
|
||
`fortitude` uses the | ||
[tree-sitter](https://tree-sitter.github.io/tree-sitter/) [Fortran | ||
grammar](https://github.com/stadelmanma/tree-sitter-fortran) to parse | ||
your source code, and currently this has some support for the | ||
preprocessor -- essentially limited to `#include`, and `#if` and | ||
`#ifdef` guards around complete statements or constructs. | ||
|
||
However, tree-sitter is fairly error tolerant, and `fortitude` should | ||
still run fine, you might just get spurious syntax errors. You can | ||
ignore these project wide with `--ignore=E001`. | ||
|
||
|
||
## What is "preview"? | ||
|
||
Preview enables a collection of newer rules and fixes that are considered experimental or unstable. | ||
See the [preview documentation](preview.md) for more details; or, to see which rules are currently | ||
in preview, visit the [rules reference](rules.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Fortitude: A Fortran Linter | ||
|
||
A Fortran linter, inspired by (and built upon) [Ruff](https://github.com/astral-sh/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: 30+ rules, with many more planned. | ||
- :page_with_curl: Multiple output formats, including SARIF and GitHub/GitLab CI. | ||
- :handshake: Follows [community best | ||
practices](https://fortran-lang.org/en/learn/best_practices/). | ||
- :muscle: Built on a robust [tree-sitter](https://tree-sitter.github.io/tree-sitter/) | ||
parser -- even syntax errors won't stop it! | ||
|
||
## Quickstart | ||
|
||
Fortitude can be installed directly into your Python environment: | ||
|
||
```console | ||
$ pip install fortitude-lint | ||
``` | ||
|
||
Run Fortitude on your project: | ||
|
||
```console | ||
$ fortitude check | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
document.addEventListener("DOMContentLoaded", function(event) { | ||
// Trigger Read the Docs' search addon instead of Material MkDocs default | ||
document.querySelector(".md-search__input").addEventListener("focus", (e) => { | ||
const event = new CustomEvent("readthedocs-search-show"); | ||
document.dispatchEvent(event); | ||
}); | ||
}); | ||
|
||
// Use CustomEvent to generate the version selector | ||
document.addEventListener( | ||
"readthedocs-addons-data-ready", | ||
function (event) { | ||
const config = event.detail.data(); | ||
const versioning = ` | ||
<div class="md-version"> | ||
<button class="md-version__current" aria-label="Select version"> | ||
${config.versions.current.slug} | ||
</button> | ||
<ul class="md-version__list"> | ||
${ config.versions.active.map( | ||
(version) => ` | ||
<li class="md-version__item"> | ||
<a href="${ version.urls.documentation }" class="md-version__link"> | ||
${ version.slug } | ||
</a> | ||
</li>`).join("\n")} | ||
</ul> | ||
</div>`; | ||
|
||
document.querySelector(".md-header__topic").insertAdjacentHTML("beforeend", versioning); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block site_meta %} | ||
{{ super() }} | ||
<meta name="readthedocs-addons-api-version" content="1" /> | ||
{% endblock %} |
Oops, something went wrong.