Skip to content

Commit b5012ec

Browse files
authored
Release bevy_lint v0.2.0 (#308)
As per the [release checklist](https://github.com/TheBevyFlock/bevy_cli/blob/cf1707a205e77808c4472cce59eb60ef6061d054/bevy_lint/docs/how-to/release.md), this PR kicks off the release of `bevy_lint` v0.2.0. ## Links - [Changelog](https://github.com/TheBevyFlock/bevy_cli/blob/32377ed5ff5fb2d4bfe0118b0fd7299b42ae7fe6/bevy_lint/CHANGELOG.md) - [Migration Guide](https://github.com/TheBevyFlock/bevy_cli/blob/32377ed5ff5fb2d4bfe0118b0fd7299b42ae7fe6/bevy_lint/MIGRATION.md) - [Readme / User Guide](https://github.com/TheBevyFlock/bevy_cli/blob/32377ed5ff5fb2d4bfe0118b0fd7299b42ae7fe6/bevy_lint/README.md) - [Commit History](https://github.com/TheBevyFlock/bevy_cli/commits/) - [Source Code](https://github.com/TheBevyFlock/bevy_cli/tree/cf1707a205e77808c4472cce59eb60ef6061d054/bevy_lint) - [Draft Release Blog Post](https://gist.github.com/BD103/181b387cf127ee45046529824f789ba3) (which will eventually go on <https://bd103.github.io/>) ## Release Process In order for v0.2.0 to be released, we need the approval of at least one Bevy maintainer and no outstanding questions / issues. Now's your chance to test the linter in its current state and make sure you're happy with it!
1 parent 0ef4a04 commit b5012ec

7 files changed

Lines changed: 24 additions & 14 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bevy_lint/CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ The format is based on [Keep a Changelog], and this project adheres to [Semantic
77
[Keep a Changelog]: https://keepachangelog.com/en/1.1.0/
88
[Semantic Versioning]: https://semver.org/spec/v2.0.0.html
99

10-
## [Unreleased]
10+
## [v0.2.0] - 2025-03-19
1111

12-
**All Changes**: [`lint-v0.1.0...main`](https://github.com/TheBevyFlock/bevy_cli/compare/lint-v0.1.0...main)
12+
**All Changes**: [`lint-v0.1.0...lint-v0.2.0`](https://github.com/TheBevyFlock/bevy_cli/compare/lint-v0.1.0...lint-v0.2.0)
1313

1414
### Added
1515

bevy_lint/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "bevy_lint"
3-
version = "0.2.0-dev"
3+
version = "0.2.0"
44
authors = ["BD103"]
55
edition = "2024"
66
description = "A collection of lints for the Bevy game engine"

bevy_lint/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ There are several other ways to toggle lints, although some have varying levels
176176

177177
|`bevy_lint` Version|Rust Version|Rustup Toolchain|Bevy Version|
178178
|-|-|-|-|
179-
|0.2.0-dev|1.84.0|`nightly-2025-02-20`|0.15|
179+
|0.2.0|1.84.0|`nightly-2025-02-20`|0.15|
180180
|0.1.0|1.84.0|`nightly-2024-11-14`|0.14|
181181

182182
The Rust version in the above table specifies what [version of the Rust language](https://github.com/rust-lang/rust/releases) can be compiled with `bevy_lint`. Code written for a later version of Rust may not compile. (This is not usually an issue, though, because `bevy_lint`'s Rust version is kept 1 to 2 releases ahead of stable Rust.)
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
//! Lints that check over `Cargo.toml` instead of your code.
22
3+
use super::duplicate_bevy_dependencies::DUPLICATE_BEVY_DEPENDENCIES;
34
use crate::declare_bevy_lint_pass;
45
use cargo_metadata::MetadataCommand;
56
use clippy_utils::sym;
6-
use duplicate_bevy_dependencies::DUPLICATE_BEVY_DEPENDENCIES;
77
use rustc_lint::{LateContext, LateLintPass};
88
use rustc_session::{config::Input, utils::was_invoked_from_cargo};
99
use rustc_span::Symbol;
1010

11-
pub mod duplicate_bevy_dependencies;
12-
1311
declare_bevy_lint_pass! {
1412
pub Cargo => [DUPLICATE_BEVY_DEPENDENCIES.lint],
1513
@default = {
@@ -37,7 +35,7 @@ impl LateLintPass<'_> for Cargo {
3735
.exec()
3836
{
3937
Ok(metadata) => {
40-
duplicate_bevy_dependencies::check(cx, &metadata, self.bevy);
38+
super::duplicate_bevy_dependencies::check(cx, &metadata, self.bevy);
4139
}
4240
Err(e) => {
4341
cx.tcx

bevy_lint/src/lints/cargo/duplicate_bevy_dependencies.rs renamed to bevy_lint/src/lints/duplicate_bevy_dependencies.rs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
//! Checks for multiple versions of the `bevy` crate in your project's dependencies.
22
//!
3+
//! This lint will prevent you from accidentally using multiple versions of the Bevy game engine at
4+
//! the same time by scanning your dependency tree for the `bevy` crate. If your project or its
5+
//! dependencies use different versions of `bevy`, this lint will emit a warning.
6+
//!
7+
//! You may also be interested in [`cargo-deny`], which can detect duplicate dependencies as well,
8+
//! and is far more powerful and configurable.
9+
//!
10+
//! [`cargo-deny`]: https://github.com/EmbarkStudios/cargo-deny
11+
//!
312
//! # Motivation
413
//!
514
//! Cargo allows there to be multiple major versions of a crate in your project's dependency
6-
//! tree[^semver-compatibility]. Though the two crates and their types are _named_ the same, they
7-
//! are treated as distinct by the compiler. This can lead to confusing error messages that only
8-
//! appear if you try to mix the types from the two versions of the crate.
15+
//! tree[^semver-compatibility]. Although the crates and their types are _named_ the same, they are
16+
//! treated as distinct by the compiler. This can lead to confusing error messages that only appear
17+
//! if you try to mix the types from the two versions of the crate.
918
//!
1019
//! With Bevy, these errors become particularly easy to encounter when you add a plugin that pulls
1120
//! in a different version of the Bevy engine. (This isn't immediately obvious, however, unless you
@@ -78,6 +87,7 @@ declare_bevy_lint! {
7887
pub DUPLICATE_BEVY_DEPENDENCIES,
7988
NURSERY,
8089
"multiple versions of the `bevy` crate found",
90+
@crate_level_only = true,
8191
}
8292

8393
#[derive(Deserialize, Debug)]

bevy_lint/src/lints/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
use crate::lint::BevyLint;
88
use rustc_lint::{Lint, LintStore};
99

10+
mod cargo;
11+
1012
pub mod borrowed_reborrowable;
11-
pub mod cargo;
13+
pub mod duplicate_bevy_dependencies;
1214
pub mod insert_event_resource;
1315
pub mod insert_unit_bundle;
1416
pub mod main_return_without_appexit;
@@ -19,7 +21,7 @@ pub mod zst_query;
1921

2022
pub(crate) static LINTS: &[&BevyLint] = &[
2123
borrowed_reborrowable::BORROWED_REBORROWABLE,
22-
cargo::duplicate_bevy_dependencies::DUPLICATE_BEVY_DEPENDENCIES,
24+
duplicate_bevy_dependencies::DUPLICATE_BEVY_DEPENDENCIES,
2325
insert_event_resource::INSERT_EVENT_RESOURCE,
2426
insert_unit_bundle::INSERT_UNIT_BUNDLE,
2527
main_return_without_appexit::MAIN_RETURN_WITHOUT_APPEXIT,

0 commit comments

Comments
 (0)