Broaden "Check for bevy_internal imports" CI Task (#15333)

# Objective

- Fixes #15319
- Fixes #15317

## Solution

- Updated CI task to check for _any_ `bevy_*` crates, rather than just
`bevy_internal`

---------

Co-authored-by: François Mockers <francois.mockers@vleue.com>
This commit is contained in:
Zachary Harrold 2024-09-21 03:08:37 +10:00 committed by GitHub
parent d7ea5b6aa9
commit 4742f74fc4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 18 additions and 15 deletions

View file

@ -419,19 +419,19 @@ jobs:
timeout-minutes: 30 timeout-minutes: 30
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Check for bevy_internal imports - name: Check for internal Bevy imports
shell: bash shell: bash
run: | run: |
errors="" errors=""
for file in $(find examples tests -name '*.rs'); do for file in $(find examples tests -name '*.rs'); do
if grep -q "use bevy_internal" "$file"; then if grep -q "use bevy_" "$file"; then
errors+="ERROR: Detected 'use bevy_internal' in $file\n" errors+="ERROR: Detected internal Bevy import in $file\n"
fi fi
done done
if [ -n "$errors" ]; then if [ -n "$errors" ]; then
echo -e "$errors" echo -e "$errors"
echo " Avoid importing bevy_internal, it should not be used directly" echo " Avoid importing internal Bevy crates, they should not be used directly"
echo " Fix the issue by replacing 'bevy_internal' with 'bevy'" echo " Fix the issue by replacing 'bevy_*' with 'bevy'"
echo " Example: 'use bevy::sprite::MaterialMesh2dBundle;' instead of 'bevy_internal::sprite::MaterialMesh2dBundle;'" echo " Example: 'use bevy::sprite::MaterialMesh2dBundle;' instead of 'bevy_internal::sprite::MaterialMesh2dBundle;'"
exit 1 exit 1
fi fi

View file

@ -3,7 +3,7 @@
use bevy::{ use bevy::{
prelude::*, prelude::*,
render::{ render::{
camera::RenderTarget, camera::{RenderTarget, ScalingMode},
render_resource::{ render_resource::{
Extent3d, TextureDescriptor, TextureDimension, TextureFormat, TextureUsages, Extent3d, TextureDescriptor, TextureDimension, TextureFormat, TextureUsages,
}, },
@ -12,7 +12,6 @@ use bevy::{
sprite::MaterialMesh2dBundle, sprite::MaterialMesh2dBundle,
window::WindowResized, window::WindowResized,
}; };
use bevy_render::camera::ScalingMode;
/// In-game resolution width. /// In-game resolution width.
const RES_WIDTH: u32 = 160; const RES_WIDTH: u32 = 160;

View file

@ -5,11 +5,11 @@ use std::f32::consts::PI;
use bevy::{ use bevy::{
prelude::*, prelude::*,
render::{ render::{
render_asset::RenderAssetUsages,
render_resource::{Extent3d, TextureDimension, TextureFormat, TextureUsages}, render_resource::{Extent3d, TextureDimension, TextureFormat, TextureUsages},
view::RenderLayers, view::RenderLayers,
}, },
}; };
use bevy_render::render_asset::RenderAssetUsages;
fn main() { fn main() {
App::new() App::new()

View file

@ -14,7 +14,7 @@ use bevy::core_pipeline::bloom::Bloom;
use bevy::core_pipeline::experimental::taa::{TemporalAntiAliasBundle, TemporalAntiAliasPlugin}; use bevy::core_pipeline::experimental::taa::{TemporalAntiAliasBundle, TemporalAntiAliasPlugin};
use bevy::pbr::{DirectionalLightShadowMap, FogVolume, VolumetricFog, VolumetricLight}; use bevy::pbr::{DirectionalLightShadowMap, FogVolume, VolumetricFog, VolumetricLight};
use bevy::prelude::*; use bevy::prelude::*;
use bevy_render::texture::{ use bevy::render::texture::{
ImageAddressMode, ImageFilterMode, ImageLoaderSettings, ImageSampler, ImageSamplerDescriptor, ImageAddressMode, ImageFilterMode, ImageLoaderSettings, ImageSampler, ImageSamplerDescriptor,
}; };

View file

@ -2,9 +2,11 @@
use bevy::{ use bevy::{
prelude::*, prelude::*,
reflect::TypePath, reflect::TypePath,
render::render_resource::{AsBindGroup, ShaderRef}, render::{
render_resource::{AsBindGroup, ShaderRef},
storage::ShaderStorageBuffer,
},
}; };
use bevy_render::storage::ShaderStorageBuffer;
const SHADER_ASSET_PATH: &str = "shaders/storage_buffer.wgsl"; const SHADER_ASSET_PATH: &str = "shaders/storage_buffer.wgsl";

View file

@ -7,10 +7,10 @@ use bevy::{
prelude::*, prelude::*,
render::{ render::{
camera::RenderTarget, camera::RenderTarget,
render_asset::RenderAssetUsages,
render_resource::{Extent3d, TextureDimension, TextureFormat, TextureUsages}, render_resource::{Extent3d, TextureDimension, TextureFormat, TextureUsages},
}, },
}; };
use bevy_render::render_asset::RenderAssetUsages;
fn main() { fn main() {
App::new() App::new()

View file

@ -1,9 +1,11 @@
//! An example showing how to save screenshots to disk //! An example showing how to save screenshots to disk
use bevy::prelude::*; use bevy::prelude::*;
use bevy::render::view::{
cursor::CursorIcon,
screenshot::{save_to_disk, Capturing, Screenshot},
};
use bevy::window::SystemCursorIcon; use bevy::window::SystemCursorIcon;
use bevy_render::view::cursor::CursorIcon;
use bevy_render::view::screenshot::{save_to_disk, Capturing, Screenshot};
fn main() { fn main() {
App::new() App::new()

View file

@ -7,9 +7,9 @@
use bevy::{ use bevy::{
ecs::schedule::{InternedScheduleLabel, LogLevel, ScheduleBuildSettings}, ecs::schedule::{InternedScheduleLabel, LogLevel, ScheduleBuildSettings},
prelude::*, prelude::*,
render::pipelined_rendering::RenderExtractApp,
utils::HashMap, utils::HashMap,
}; };
use bevy_render::pipelined_rendering::RenderExtractApp;
fn main() { fn main() {
let mut app = App::new(); let mut app = App::new();