Skip to content

Commit

Permalink
Broaden _Check for bevy_internal imports_ CI Task
Browse files Browse the repository at this point in the history
Now checks for any `bevy_*` crates in examples
  • Loading branch information
bushrat011899 committed Sep 20, 2024
1 parent d7ea5b6 commit 94954b8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -419,19 +419,19 @@ jobs:
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Check for bevy_internal imports
- 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"
if grep -q "use bevy_" "$file"; then
errors+="ERROR: Detected internal Bevy import 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 " Avoid importing internal Bevy crates, they should not be used directly"
echo " Fix the issue by replacing 'bevy_*' with 'bevy'"
echo " Example: 'use bevy::sprite::MaterialMesh2dBundle;' instead of 'bevy_internal::sprite::MaterialMesh2dBundle;'"
exit 1
fi

0 comments on commit 94954b8

Please sign in to comment.