Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for bevy_internal imports in CI #9612

Merged
merged 5 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -333,3 +333,25 @@ jobs:
with:
name: msrv
path: msrv/

check-bevy-internal-imports:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- name: Check for bevy_internal imports
shell: bash
run: |
errors=""
for file in $(find examples tests -name '*.rs'); do
if grep -q "use bevy_internal" "$file"; then
errors+="ERROR: Detected 'use bevy_internal' in $file\n"
fi
done
if [ -n "$errors" ]; then
echo -e "$errors"
echo " Avoid importing bevy_internal, it should not be used directly"
echo " Fix the issue by replacing 'bevy_internal' with 'bevy'"
echo " Example: 'use bevy::sprite::MaterialMesh2dBundle;' instead of 'bevy_internal::sprite::MaterialMesh2dBundle;'"
exit 1
fi
4 changes: 1 addition & 3 deletions examples/animation/animated_fox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
use std::f32::consts::PI;
use std::time::Duration;

use bevy::pbr::CascadeShadowConfigBuilder;
use bevy::prelude::*;
use bevy_internal::animation::RepeatAnimation;
use bevy::{animation::RepeatAnimation, pbr::CascadeShadowConfigBuilder, prelude::*};

fn main() {
App::new()
Expand Down