Takes the first two commits from #15375 and adds suggestions from this comment: https://github.com/bevyengine/bevy/pull/15375#issuecomment-2366968300 See #15375 for more reasoning/motivation. ## Rebasing (rerunning) ```rust git switch simpler-lint-fixes git reset --hard main cargo fmt --all -- --unstable-features --config normalize_comments=true,imports_granularity=Crate cargo fmt --all git add --update git commit --message "rustfmt" cargo clippy --workspace --all-targets --all-features --fix cargo fmt --all -- --unstable-features --config normalize_comments=true,imports_granularity=Crate cargo fmt --all git add --update git commit --message "clippy" git cherry-pick e6c0b94f6795222310fb812fa5c4512661fc7887 ```
20 lines
607 B
Rust
20 lines
607 B
Rust
use crate::{
|
|
commands::{ClippyCommand, FormatCommand},
|
|
Flag, Prepare, PreparedCommand,
|
|
};
|
|
use argh::FromArgs;
|
|
|
|
/// Alias for running the `format` and `clippy` subcommands.
|
|
#[derive(FromArgs, Default)]
|
|
#[argh(subcommand, name = "lints")]
|
|
pub struct LintsCommand {}
|
|
|
|
impl Prepare for LintsCommand {
|
|
fn prepare<'a>(&self, sh: &'a xshell::Shell, flags: Flag) -> Vec<PreparedCommand<'a>> {
|
|
let mut commands = vec![];
|
|
commands.append(&mut FormatCommand::default().prepare(sh, flags));
|
|
commands.append(&mut ClippyCommand::default().prepare(sh, flags));
|
|
commands
|
|
}
|
|
}
|