Contribution guidelines: Difference between revisions
Add clippy to code guidelines. |
mNo edit summary |
||
| Line 17: | Line 17: | ||
== Code guidelines == | == Code guidelines == | ||
Check for [https://doc.rust-lang.org/stable/clippy/index.html Clippy] lints by running <code>cargo clippy</code> | Check for [https://doc.rust-lang.org/stable/clippy/index.html Clippy] lints by running <code>cargo clippy</code> and apply suggested changes, if any. If there is good reason not to apply a suggestion, add an <code>#[allow(clippy::some_lint)]</code> attribute to the smallest possible region (e.g. the function containing the offending code), along with a comment explaining your decision. | ||
Ensure that all code has been formatted with [https://rust-lang.github.io/rustfmt/ Rustfmt] before committing. This can be done by configuring your editor to autoformat on save or by running <code>cargo fmt</code>. | Ensure that all code has been formatted with [https://rust-lang.github.io/rustfmt/ Rustfmt] before committing. This can be done by configuring your editor to autoformat on save or by running <code>cargo fmt</code>. | ||
Revision as of 01:41, 3 April 2026
This page contains guidelines for contributing code to jabara.
Source access
jabara is developed on a dedicated Forgejo instance hosted at git.zelda.sr. The primary repository is located under the jabara organization at jabara/jabara.
Submitting changes
Contributions to jabara should be made as pull requests to the repository. (Guidelines TBD)
Git guidelines
Git commit messages should follow the Conventional Commits conventions. Here are a few well-formed examples:
chore: flatten imports and re-export `Cpu`fix(docs): use `align` instead of `style`
After the first release, changelogs will be kept as described by Keep a Changelog.
Code guidelines
Check for Clippy lints by running cargo clippy and apply suggested changes, if any. If there is good reason not to apply a suggestion, add an #[allow(clippy::some_lint)] attribute to the smallest possible region (e.g. the function containing the offending code), along with a comment explaining your decision.
Ensure that all code has been formatted with Rustfmt before committing. This can be done by configuring your editor to autoformat on save or by running cargo fmt.
You can disallow local commits with clippy lints or formatting issues by creating a pre-commit hook. Create an executable file at .git/hooks/pre-commit with the following content:
#!/bin/sh cargo clippy -- -Dwarnings cargo fmt --check