giraffate / clippy-action

MIT License
64 stars 6 forks source link

Catch error level from Clippy #25

Closed giraffate closed 1 year ago

giraffate commented 1 year ago

This fix error level bugs. This enables following:

github-pr-review

cargo clippy cargo clippy -- -Dwarnings
github-pr-review_warning github-pr-review_error

github-pr-check

cargo clippy cargo clippy -- -Dwarnings
github-pr-check_warning github-pr-check_error
danieleades commented 1 year ago

I've just tested this PR in a forked repo. The checks work as expected- clippy warnings are reported as warnings, and errors as errors.

Unfortunately the job passes regardless of the clippy error 'level'. I would expect that if there are any clippy 'error' level annotations then the CI job would also fail

here's a job with error level clippy annotations that still passes - https://github.com/mavlink/rust-mavlink/actions/runs/3593309294/jobs/6050099706

using my previous table, the current state is now-

behaviour repo contains... clippy-action reports... action status
github-pr-check clippy warnings warnings passed
desired clippy warnings warnings passed
github-pr-check clippy errors errors passed
desired clippy errors errors failed
giraffate commented 1 year ago

Thanks for checking it! I'll merge this after updating README.

Unfortunately the job passes regardless of the clippy error 'level'. I would expect that if there are any clippy 'error' level annotations then the CI job would also fail

I was mistaken. That could be controlled by fail_on_error: true option.

danieleades commented 1 year ago

I'm still having problems with the version in this PR- this job should have passed, but has failed: https://github.com/mavlink/rust-mavlink/actions/runs/3599382155/jobs/6062965138

It appears that fail_on_error is causing the job to fail on warnings too.

It has also failed to annotate the diff - https://github.com/mavlink/rust-mavlink/pull/143/files

There's another unrelated issue- the clippy-action logs are thousands of lines long. So big that they can't be viewed in the github UI. This repo generates a lot of code during the build. This generated code seems to be included in its entirety in the logs.

danieleades commented 1 year ago

i guess this is probably relevant - https://github.com/reviewdog/reviewdog/issues/856

giraffate commented 1 year ago

Thanks! Looks just like it. Hmm, this is the way to do it for now:

There's another unrelated issue- the clippy-action logs are thousands of lines long. So big that they can't be viewed in the github UI. This repo generates a lot of code during the build. This generated code seems to be included in its entirety in the logs.

Yes, it's a very long log. I'll investigating the way to suppress log.

giraffate commented 1 year ago

I updated README, so merge this PR.

@danieleades Thanks for your comments! Feel free to have them comment even after this PR has been merged.

giraffate commented 1 year ago

https://github.com/giraffate/clippy-action/pull/25#issuecomment-1334815229

There's another unrelated issue- the clippy-action logs are thousands of lines long. So big that they can't be viewed in the github UI. This repo generates a lot of code during the build. This generated code seems to be included in its entirety in the logs.

I fixed this at https://github.com/giraffate/clippy-action/pull/26. Thanks for the report!