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

ci: use sarif tools for clippy annotations #69

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
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
18 changes: 14 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,19 @@ jobs:
- name: Install clippy
run: rustup component add clippy

- name: Run clippy
uses: actions-rs/clippy-check@v1
- name: Install annotation utils
run: cargo install clippy-sarif sarif-fmt

- name: Run rust-clippy
run:
cargo clippy
--all --bins --examples --tests --benches --message-format=json -- -Wclippy::all -Dwarnings
| clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
continue-on-error: true

- name: Upload analysis results to GitHub
uses: github/codeql-action/upload-sarif@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all --bins --examples --tests --benches -- -Wclippy::all -Dwarnings
sarif_file: rust-clippy-results.sarif
wait-for-processing: true

4 changes: 3 additions & 1 deletion src/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,10 @@
old_state
}

#[allow(clippy::match_like_matches_macro)] // otherwise bumps MSRV
// #[allow(clippy::match_like_matches_macro)] // otherwise bumps MSRV
pub fn is_transient(&self) -> bool {
let a_thing = 0usize;

Check warning on line 337 in src/reader.rs

View check run for this annotation

Codecov / codecov/patch

src/reader.rs#L337

Added line #L337 was not covered by tests

Check failure

Code scanning / clippy

unused variable: a_thing Error

unused variable: a\_thing

Check failure

Code scanning / clippy

unused variable: a_thing Error

unused variable: a\_thing

if let StreamState::Events = self {
false
} else {
Expand Down
Loading