Skip to content

Commit

Permalink
proper check for custom lint failures
Browse files Browse the repository at this point in the history
  • Loading branch information
sam0x17 committed Aug 9, 2024
1 parent b98133d commit af6435a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/check-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ jobs:
run: cargo clippy --workspace --all-targets -- -D warnings

cargo-check-lints:
name: no warnings or custom lint failures
name: check custom lints
runs-on: SubtensorCI
strategy:
matrix:
Expand Down Expand Up @@ -158,8 +158,20 @@ jobs:
with:
key: ${{ matrix.os }}-${{ env.RUST_BIN_DIR }}

- name: cargo check --workspace (no warnings allowed)
run: cargo check --workspace
- name: check lints
# regular cargo check is sufficient here as we only need to trigger the build script
# which will nevertheless check the whole workspace
run: |
set -e # Fail the script if any command fails
cargo check 2>&1 | tee build_output.log
warnings=$(grep "cargo:warning=" build_output.log || true)
if [ -n "$warnings" ]; then
echo "The following custom lints have failed ❌:"
echo "$warnings"
exit 1
else
echo "All custom lints passed ✅"
fi
cargo-clippy-all-features:
name: cargo clippy --all-features
Expand Down
2 changes: 0 additions & 2 deletions support/linting/src/require_freeze_struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ use syn::{

pub struct RequireFreezeStruct;

fn meh() {}

impl Lint for RequireFreezeStruct {
fn lint(source: &TokenStream) -> Result<()> {
let mut visitor = EncodeDecodeVisitor::default();
Expand Down

0 comments on commit af6435a

Please sign in to comment.