mirror of
https://github.com/bevyengine/bevy
synced 2024-11-27 15:10:19 +00:00
Allow clippy::type_complexity
in more places. (#9796)
# Objective - See fewer warnings when running `cargo clippy` locally. ## Solution - allow `clippy::type_complexity` in more places, which also signals to users they should do the same.
This commit is contained in:
parent
73e0ac26ca
commit
9a798aa100
14 changed files with 48 additions and 4 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
#![allow(clippy::type_complexity)]
|
||||||
|
|
||||||
pub mod io;
|
pub mod io;
|
||||||
pub mod meta;
|
pub mod meta;
|
||||||
pub mod processor;
|
pub mod processor;
|
||||||
|
|
|
@ -13,13 +13,12 @@ cargo fmt --all
|
||||||
Can be automatically run with [`cargo run -p ci`](../tools/ci) (which also runs other checks) or manually with this command:
|
Can be automatically run with [`cargo run -p ci`](../tools/ci) (which also runs other checks) or manually with this command:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cargo clippy --workspace --all-targets --all-features -- -D warnings -A clippy::type_complexity
|
cargo clippy --workspace --all-targets --all-features -- -D warnings
|
||||||
```
|
```
|
||||||
|
|
||||||
Explanation:
|
Explanation:
|
||||||
|
|
||||||
* `-D warnings`: No warnings are allowed in the codebase.
|
* `-D warnings`: No warnings are allowed in the codebase.
|
||||||
* `-A clippy::type_complexity`: type complexity must be ignored because we use huge templates for queries.
|
|
||||||
|
|
||||||
## [super-linter](https://github.com/github/super-linter)
|
## [super-linter](https://github.com/github/super-linter)
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
//! This example compares MSAA (Multi-Sample Anti-aliasing), FXAA (Fast Approximate Anti-aliasing), and TAA (Temporal Anti-aliasing).
|
//! This example compares MSAA (Multi-Sample Anti-aliasing), FXAA (Fast Approximate Anti-aliasing), and TAA (Temporal Anti-aliasing).
|
||||||
|
|
||||||
|
// This lint usually gives bad advice in the context of Bevy -- hiding complex queries behind
|
||||||
|
// type aliases tends to obfuscate code while offering no improvement in code cleanliness.
|
||||||
|
#![allow(clippy::type_complexity)]
|
||||||
|
|
||||||
use std::f32::consts::PI;
|
use std::f32::consts::PI;
|
||||||
|
|
||||||
use bevy::{
|
use bevy::{
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
//! Demonstrates how to prevent meshes from casting/receiving shadows in a 3d scene.
|
//! Demonstrates how to prevent meshes from casting/receiving shadows in a 3d scene.
|
||||||
|
|
||||||
|
// This lint usually gives bad advice in the context of Bevy -- hiding complex queries behind
|
||||||
|
// type aliases tends to obfuscate code while offering no improvement in code cleanliness.
|
||||||
|
#![allow(clippy::type_complexity)]
|
||||||
|
|
||||||
use std::f32::consts::PI;
|
use std::f32::consts::PI;
|
||||||
|
|
||||||
use bevy::{
|
use bevy::{
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
//! A scene showcasing screen space ambient occlusion.
|
//! A scene showcasing screen space ambient occlusion.
|
||||||
|
|
||||||
|
// This lint usually gives bad advice in the context of Bevy -- hiding complex queries behind
|
||||||
|
// type aliases tends to obfuscate code while offering no improvement in code cleanliness.
|
||||||
|
#![allow(clippy::type_complexity)]
|
||||||
|
|
||||||
use bevy::{
|
use bevy::{
|
||||||
core_pipeline::experimental::taa::{TemporalAntiAliasBundle, TemporalAntiAliasPlugin},
|
core_pipeline::experimental::taa::{TemporalAntiAliasBundle, TemporalAntiAliasPlugin},
|
||||||
pbr::{
|
pbr::{
|
||||||
|
|
|
@ -12,6 +12,10 @@
|
||||||
//!
|
//!
|
||||||
//! For more details on the `WorldQuery` derive macro, see the trait documentation.
|
//! For more details on the `WorldQuery` derive macro, see the trait documentation.
|
||||||
|
|
||||||
|
// This lint usually gives bad advice in the context of Bevy -- hiding complex queries behind
|
||||||
|
// type aliases tends to obfuscate code while offering no improvement in code cleanliness.
|
||||||
|
#![allow(clippy::type_complexity)]
|
||||||
|
|
||||||
use bevy::{ecs::query::WorldQuery, prelude::*};
|
use bevy::{ecs::query::WorldQuery, prelude::*};
|
||||||
use std::fmt::Debug;
|
use std::fmt::Debug;
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,10 @@
|
||||||
//!
|
//!
|
||||||
//! In this case, we're transitioning from a `Menu` state to an `InGame` state.
|
//! In this case, we're transitioning from a `Menu` state to an `InGame` state.
|
||||||
|
|
||||||
|
// This lint usually gives bad advice in the context of Bevy -- hiding complex queries behind
|
||||||
|
// type aliases tends to obfuscate code while offering no improvement in code cleanliness.
|
||||||
|
#![allow(clippy::type_complexity)]
|
||||||
|
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
//! Eat the cakes. Eat them all. An example 3D game.
|
//! Eat the cakes. Eat them all. An example 3D game.
|
||||||
|
|
||||||
|
// This lint usually gives bad advice in the context of Bevy -- hiding complex queries behind
|
||||||
|
// type aliases tends to obfuscate code while offering no improvement in code cleanliness.
|
||||||
|
#![allow(clippy::type_complexity)]
|
||||||
|
|
||||||
use std::f32::consts::PI;
|
use std::f32::consts::PI;
|
||||||
|
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
|
|
|
@ -2,6 +2,10 @@
|
||||||
//! change some settings or quit. There is no actual game, it will just display the current
|
//! change some settings or quit. There is no actual game, it will just display the current
|
||||||
//! settings for 5 seconds before going back to the menu.
|
//! settings for 5 seconds before going back to the menu.
|
||||||
|
|
||||||
|
// This lint usually gives bad advice in the context of Bevy -- hiding complex queries behind
|
||||||
|
// type aliases tends to obfuscate code while offering no improvement in code cleanliness.
|
||||||
|
#![allow(clippy::type_complexity)]
|
||||||
|
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
|
|
||||||
const TEXT_COLOR: Color = Color::rgb(0.9, 0.9, 0.9);
|
const TEXT_COLOR: Color = Color::rgb(0.9, 0.9, 0.9);
|
||||||
|
|
|
@ -4,6 +4,10 @@
|
||||||
//! Clicking toggle IME (Input Method Editor) support, but the font used as limited support of characters.
|
//! Clicking toggle IME (Input Method Editor) support, but the font used as limited support of characters.
|
||||||
//! You should change the provided font with another one to test other languages input.
|
//! You should change the provided font with another one to test other languages input.
|
||||||
|
|
||||||
|
// This lint usually gives bad advice in the context of Bevy -- hiding complex queries behind
|
||||||
|
// type aliases tends to obfuscate code while offering no improvement in code cleanliness.
|
||||||
|
#![allow(clippy::type_complexity)]
|
||||||
|
|
||||||
use bevy::{input::keyboard::KeyboardInput, prelude::*};
|
use bevy::{input::keyboard::KeyboardInput, prelude::*};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
// This lint usually gives bad advice in the context of Bevy -- hiding complex queries behind
|
||||||
|
// type aliases tends to obfuscate code while offering no improvement in code cleanliness.
|
||||||
|
#![allow(clippy::type_complexity)]
|
||||||
|
|
||||||
use bevy::{input::touch::TouchPhase, prelude::*, window::WindowMode};
|
use bevy::{input::touch::TouchPhase, prelude::*, window::WindowMode};
|
||||||
|
|
||||||
// the `bevy_main` proc_macro generates the required boilerplate for iOS and Android
|
// the `bevy_main` proc_macro generates the required boilerplate for iOS and Android
|
||||||
|
|
|
@ -3,6 +3,10 @@
|
||||||
//! - Copy the code for the `SceneViewerPlugin` and add the plugin to your App.
|
//! - Copy the code for the `SceneViewerPlugin` and add the plugin to your App.
|
||||||
//! - Insert an initialized `SceneHandle` resource into your App's `AssetServer`.
|
//! - Insert an initialized `SceneHandle` resource into your App's `AssetServer`.
|
||||||
|
|
||||||
|
// This lint usually gives bad advice in the context of Bevy -- hiding complex queries behind
|
||||||
|
// type aliases tends to obfuscate code while offering no improvement in code cleanliness.
|
||||||
|
#![allow(clippy::type_complexity)]
|
||||||
|
|
||||||
use bevy::{
|
use bevy::{
|
||||||
asset::LoadState, gltf::Gltf, input::common_conditions::input_just_pressed, prelude::*,
|
asset::LoadState, gltf::Gltf, input::common_conditions::input_just_pressed, prelude::*,
|
||||||
scene::InstanceId,
|
scene::InstanceId,
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
//! This example illustrates how to create a button that changes color and text based on its
|
//! This example illustrates how to create a button that changes color and text based on its
|
||||||
//! interaction state.
|
//! interaction state.
|
||||||
|
|
||||||
|
// This lint usually gives bad advice in the context of Bevy -- hiding complex queries behind
|
||||||
|
// type aliases tends to obfuscate code while offering no improvement in code cleanliness.
|
||||||
|
#![allow(clippy::type_complexity)]
|
||||||
|
|
||||||
use bevy::{prelude::*, winit::WinitSettings};
|
use bevy::{prelude::*, winit::WinitSettings};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
|
@ -17,8 +17,7 @@ bitflags! {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const CLIPPY_FLAGS: [&str; 7] = [
|
const CLIPPY_FLAGS: [&str; 6] = [
|
||||||
"-Aclippy::type_complexity",
|
|
||||||
"-Wclippy::doc_markdown",
|
"-Wclippy::doc_markdown",
|
||||||
"-Wclippy::redundant_else",
|
"-Wclippy::redundant_else",
|
||||||
"-Wclippy::match_same_arms",
|
"-Wclippy::match_same_arms",
|
||||||
|
|
Loading…
Reference in a new issue