Skip to content

Latest commit

 

History

History
68 lines (49 loc) · 2.01 KB

README.dev.md

File metadata and controls

68 lines (49 loc) · 2.01 KB

Fortitude Development

Installation from source

To install from source, you must first have a working Rust environment (see rustup). The project may then be installed from the project root directory using either pip:

python -m venv venv # Or use your preferred virtual environment method...
source venv/bin/activate
pip install .[lint]

Or using cargo:

cargo install --path fortitude

Testing

Unit tests can be run by calling:

cargo test

Integration testing is currently being performed manually using the file test.f90:

fortitude check test.f90

The test suite is still in need of work, and we hope to include automated integration tests soon.

Linting and Formatting

When contributing, please use cargo clippy for linting and cargo fmt for formatting. If you edit any Python code, please also use ruff check and ruff format. To avoid accidentally pushing unlinted/unformatted code to GitHub, we recommend using the Git pre-commit hook provided:

git config --local core.hooksPath .githooks

Adding Rules

Similarly to how Ruff names rules, the rules in Fortitude should be categorised appropriately and their name should describe the pattern the rule is intended to fix. Words such as 'forbid' should be omitted. For example, the name for the rule that warns of overly long lines is LineTooLong, and not something like AvoidLineTooLong or KeepLinesShort.

Making New Releases

To make a new release, the following steps must be completed in order:

  • Make a new commit that updates the project version in pyproject.toml, Cargo.toml, and CITATION.cff.
    • Remember to run cargo build to update the Cargo.lock file too!
  • Open a new PR to merge this change.
  • After merging, make a new release on GitHub.
    • This will automatically upload the new version to PyPI.
  • On your machine, pull the main branch, and run cargo publish.
    • This will upload the Rust crate to crates.io.