Skip to content

Commit a3b7171

Browse files
committed
Add Readme
1 parent f75bd60 commit a3b7171

File tree

4 files changed

+38
-3
lines changed

4 files changed

+38
-3
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
run: cargo install cargo-dylint; cargo install dylint-link
9393
if: steps.cache.outputs.cache-hit != 'true'
9494
- name: Run dylint
95-
run: cargo dylint --all --workspace
95+
run: cargo dylint --all --workspace -- --all-targets
9696
- name: Check Format
9797
run: cd crates/bevy_lint; cargo fmt --all -- --check
9898
- name: Check Clippy

crates/bevy_lint/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "bevy_lint"
33
version = "0.1.0"
44
authors = ["Bevy Contributors <[email protected]>"]
5-
description = "decription goes here"
5+
description = "Provides Lints for Bevy Code"
66
edition = "2018"
77
publish = false
88

crates/bevy_lint/readme.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Bevy Lint
2+
3+
## What is Bevy Lint?
4+
5+
This crates provides Lints for Bevy Code using [dylint](https://github.com/trailofbits/dylint).
6+
7+
## How to you run Lints
8+
9+
Add this to your Cargo.toml:
10+
11+
```toml
12+
[workspace.metadata.dylint]
13+
libraries = [
14+
{ git = "https://github.com/bevyengine/bevy", tag = "v0.6.0", pattern = "crates/bevy_dylint" },
15+
]
16+
```
17+
18+
Instead of a `tag`, you can also provide a `branch` or a `rev` (revision).
19+
20+
Afterwards you need to run these commans:
21+
22+
```sh
23+
cargo install cargo-dylint dylint-link # Only neccesary once
24+
cargo dylint bevy_dylint
25+
```
26+
27+
## Lint Creation
28+
29+
A Lint is created by implementing the [LateLintPass](https://doc.rust-lang.org/stable/nightly-rustc/rustc_lint/trait.LateLintPass.html) trait and adding to the `register_lints` function.
30+
31+
When creating a UI Test, add the Test as an Example to the [Cargo.toml](Cargo.toml).
32+
Also make sure that your `.stderr` File uses `LF` Line-endings and not `CRLF`, as otherwise the Test will fail without any explanation.
33+
34+
For more Resources you can take a look at the [dylint resources](https://github.com/trailofbits/dylint#resources).

crates/bevy_lint/src/unnecessary_with.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ use crate::bevy_paths;
1212

1313
declare_lint! {
1414
/// **What it does:**
15-
/// Detectes unnecessary instances of the `With`
15+
/// Detects unnecessary `With` query filters in Bevy query parameters.
1616
/// **Why is this bad?**
17+
/// The Filter does not effect the Results of a query, but still wasted space.
1718
///
1819
/// **Known problems:** None.
1920
///

0 commit comments

Comments
 (0)