1
Fork 0

Add the cargo-make configuration and Development section.

This commit is contained in:
Bauke 2024-01-25 13:07:15 +01:00
parent 0dad193657
commit ab81ae6591
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
2 changed files with 24 additions and 27 deletions

View File

@ -1,33 +1,21 @@
[tasks.fmt]
command = "cargo"
args = ["fmt", "${@}"]
[tasks.check]
command = "cargo"
args = ["check", "${@}"]
[tasks.clippy]
command = "cargo"
args = ["clippy", "${@}"]
[tasks.test]
command = "cargo"
args = ["test", "${@}"]
[tasks.doc]
command = "cargo"
args = ["doc", "${@}"]
[tasks.build]
command = "cargo"
args = ["build", "${@}"]
# Do a full check of everything.
[tasks.complete-check]
dependencies = ["fmt", "check", "clippy", "test", "doc", "build"]
dependencies = [
"format",
"spellcheck",
"check",
"clippy",
"test",
"code-coverage",
"docs",
"build",
"audit-flow",
"outdated-flow",
]
# Run cargo-tarpaulin and output the test coverage.
[tasks.code-coverage]
workspace = false
install_crate = "cargo-tarpaulin"
command = "cargo"
args = [
"tarpaulin",
@ -35,5 +23,10 @@ args = [
"--out=html",
"--output-dir=coverage",
"--skip-clean",
"--target-dir=target/tarpaulin"
"--target-dir=target/tarpaulin",
]
# Do a source code spellcheck.
[tasks.spellcheck]
clear = true
command = "typos"

View File

@ -40,6 +40,10 @@ assert_eq!(custom.from_str::<i32>("BA").unwrap(), 6);
assert!(custom.to_string(9).is_err());
```
## Development
With [Nix flakes](https://nixos.wiki/wiki/Flakes) and [direnv](https://direnv.net/) installed and enabled, all the required dependencies are automatically loaded from [`shell.nix`](./shell.nix). Then [cargo-make](https://sagiegurari.github.io/cargo-make/) can be used to build, deploy and lint the code. The available tasks are all described in the [`Makefile.toml`](Makefile.toml) configuration.
## Feedback
Found a problem or want to request a new feature? Email [helllo@holllo.org](mailto:helllo@holllo.org) and I'll see what I can do for you.