2021-02-22 04:50:05 +00:00
# Linters in this Repository
2021-04-12 19:11:40 +00:00
## Code Format Linting with [rustfmt](https://github.com/rust-lang/rustfmt)
2021-02-22 04:50:05 +00:00
2021-04-12 19:11:40 +00:00
Can be automatically validated with [`cargo run -p ci` ](../tools/ci ) (which also runs other checks). Running this command will actually format the code:
2021-02-22 04:50:05 +00:00
```bash
2021-04-12 19:11:40 +00:00
cargo fmt --all
2021-02-22 04:50:05 +00:00
```
2021-04-12 19:11:40 +00:00
## Code Linting with [Clippy](https://github.com/rust-lang/rust-clippy)
2021-02-22 04:50:05 +00:00
2021-04-12 19:11:40 +00:00
Can be automatically run with [`cargo run -p ci` ](../tools/ci ) (which also runs other checks) or manually with this command:
2021-02-22 04:50:05 +00:00
```bash
2023-10-02 21:55:16 +00:00
cargo clippy --workspace --all-targets --all-features -- -D warnings
2021-02-22 04:50:05 +00:00
```
2021-04-12 19:11:40 +00:00
Explanation:
2021-02-22 04:50:05 +00:00
* `-D warnings` : No warnings are allowed in the codebase.
## [super-linter](https://github.com/github/super-linter)
`super-linter` provides easy access to many different Linters.
### [markdownlint](https://github.com/DavidAnson/markdownlint)
`markdownlint` is provided by `super-linter` and is responsible for `.md` files.
2021-05-02 20:22:32 +00:00
Its configuration is saved in the [.markdown-lint.yml ](../.github/linters/.markdown-lint.yml ) file.
2021-02-22 04:50:05 +00:00
The provided rules are documented [here ](https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md ) and information about setting the config can be seen [here ](https://github.com/DavidAnson/markdownlint#optionsconfig ).
#### Using [VS Code markdownlint](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint)
2021-05-01 18:26:49 +00:00
If you want to use the VS Code Extension with the rules defined in [.markdown-lint.yml ](../.github/linters/.markdown-lint.yml ), then you need to create a local config file in the root of the project with the configuration below.
2021-02-22 04:50:05 +00:00
Currently, this is not needed as the extension already disables the rule `MD013` by default.
```json
{
"extends": ".github/linters/.markdown-lint.yml"
}
```
### Other Linters provided by [super-linter](https://github.com/github/super-linter)
:pencil2: Fix typos across bevy (#16702)
# Objective
Fixes typos in bevy project, following suggestion in
https://github.com/bevyengine/bevy-website/pull/1912#pullrequestreview-2483499337
## Solution
I used https://github.com/crate-ci/typos to find them.
I included only the ones that feel undebatable too me, but I am not in
game engine so maybe some terms are expected.
I left out the following typos:
- `reparametrize` => `reparameterize`: There are a lot of occurences, I
believe this was expected
- `semicircles` => `hemicircles`: 2 occurences, may mean something
specific in geometry
- `invertation` => `inversion`: may mean something specific
- `unparented` => `parentless`: may mean something specific
- `metalness` => `metallicity`: may mean something specific
## Testing
- Did you test these changes? If so, how? I did not test the changes,
most changes are related to raw text. I expect the others to be tested
by the CI.
- Are there any parts that need more testing? I do not think
- How can other people (reviewers) test your changes? Is there anything
specific they need to know? To me there is nothing to test
- If relevant, what platforms did you test these changes on, and are
there any important ones you can't test?
---
## Migration Guide
> This section is optional. If there are no breaking changes, you can
delete this section.
(kept in case I include the `reparameterize` change here)
- If this PR is a breaking change (relative to the last release of
Bevy), describe how a user might need to migrate their code to support
these changes
- Simply adding new functionality is not a breaking change.
- Fixing behavior that was definitely a bug, rather than a questionable
design choice is not a breaking change.
## Questions
- [x] Should I include the above typos? No
(https://github.com/bevyengine/bevy/pull/16702#issuecomment-2525271152)
- [ ] Should I add `typos` to the CI? (I will check how to configure it
properly)
This project looks awesome, I really enjoy reading the progress made,
thanks to everyone involved.
2024-12-08 01:18:39 +00:00
All other linters not mentioned in this file are not activated and can be seen [here ](https://github.com/github/super-linter#supported-linters ).