Skip to content

Commit bbe8f66

Browse files
add lint config, matching bevy's (#26)
* add lint config * scaffold some docs to pass lints
1 parent 14dd2a3 commit bbe8f66

File tree

30 files changed

+84
-0
lines changed

30 files changed

+84
-0
lines changed

Cargo.toml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,28 @@ members = ["crates/*"]
1212
[[bin]]
1313
name = "bevy_editor_standalone"
1414
path = "crates/bevy_editor/src/main.rs"
15+
16+
[workspace.lints.clippy]
17+
doc_markdown = "warn"
18+
manual_let_else = "warn"
19+
match_same_arms = "warn"
20+
redundant_closure_for_method_calls = "warn"
21+
redundant_else = "warn"
22+
semicolon_if_nothing_returned = "warn"
23+
type_complexity = "allow"
24+
undocumented_unsafe_blocks = "warn"
25+
unwrap_or_default = "warn"
26+
27+
ptr_as_ptr = "warn"
28+
ptr_cast_constness = "warn"
29+
ref_as_ptr = "warn"
30+
31+
[workspace.lints.rust]
32+
missing_docs = "warn"
33+
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(docsrs_dep)'] }
34+
unsafe_code = "deny"
35+
unsafe_op_in_unsafe_fn = "warn"
36+
unused_qualifications = "warn"
37+
38+
[lints]
39+
workspace = true

crates/bevy_color_picker/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ version = "0.1.0"
44
edition = "2021"
55

66
[dependencies]
7+
8+
[lints]
9+
workspace = true

crates/bevy_color_picker/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//! A color picker widget for Bevy applications.
22
3+
/// an add function that adds two numbers
34
pub fn add(left: u64, right: u64) -> u64 {
45
left + right
56
}

crates/bevy_command_palette/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ version = "0.1.0"
44
edition = "2021"
55

66
[dependencies]
7+
8+
[lints]
9+
workspace = true

crates/bevy_command_palette/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
//!
66
//! Search and keyboard shortcuts will both be supported.
77
8+
/// an add function that adds two numbers
89
pub fn add(left: u64, right: u64) -> u64 {
910
left + right
1011
}

crates/bevy_context_menu/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ version = "0.1.0"
44
edition = "2021"
55

66
[dependencies]
7+
8+
[lints]
9+
workspace = true

crates/bevy_context_menu/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//! This crate opens up a menu with a list of options when the user right-clicks (or otherwise triggers the context menu),
44
//! based on what the user has clicked on.
55
6+
/// an add function that adds two numbers
67
pub fn add(left: u64, right: u64) -> u64 {
78
left + right
89
}

crates/bevy_editor/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ version = "0.1.0"
44
edition = "2021"
55

66
[dependencies]
7+
8+
[lints]
9+
workspace = true

crates/bevy_editor_camera/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ version = "0.1.0"
44
edition = "2021"
55

66
[dependencies]
7+
8+
[lints]
9+
workspace = true

crates/bevy_editor_camera/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//! A set of camera controllers suitable for controlling editor-style views and scene exploration.
22
3+
/// an add function that adds two numbers
34
pub fn add(left: u64, right: u64) -> u64 {
45
left + right
56
}

0 commit comments

Comments
 (0)