Skip to content

Quality Assurance

Before submitting a pull request, it is recommended to run several quality assurance checks to ensure that your changes are in good shape. These quality assurance checks are also enforced in the CI. We understand that some rules are opinionated and can be counter-productive in certain cases, but please try to follow them as much as possible for consistency of the Deskulpt codebase.

Formatting

bash
pnpm format

This will run rustfmt on Rust sources and prettier on JavaScript, TypeScript, Markdown, and other assets. Automatic fixes will be applied. To run them separately, you can also use the following commands:

bash
pnpm format:rs
pnpm format:js

If you only want to check for formatting errors without applying automatic fixes, append :check to each of the commands above.

Linting

bash
pnpm lint

This will run clippy on Rust sources and oxlint on JavaScript and TypeScript sources. Automatic fixes will be applied where possible. To run them separately, you can also use the following commands:

bash
pnpm lint:rs
pnpm lint:js

If you only want to check for linting errors without applying automatic fixes, append :check to each of the commands above.

Pre-Commit Hooks

Deskulpt uses husky to register some of the quality assurance checks as pre-commit hooks, so that they are automatically run on the files you commit every time. These pre-commit hooks are automatically registered when you run pnpm install.

There are circumstances where you may not want these hooks to run for certain commits. In such cases, you can use the -n flag to bypass the hooks:

bash
git commit -n -m "YOUR COMMIT MESSAGE"

However, note that the CI pipeline still enforces all checks on the pull requests, so bypassing hooks locally should only be the exception.

Released under the MIT License.