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

clippy: do not fail scan of packages without Rust code #169

Closed
wants to merge 1 commit into from

Conversation

kdudka
Copy link
Member

@kdudka kdudka commented May 28, 2024

We want to enable clippy in the default scanning profile in a way that it takes an effect for packages that build Rust code. For packages that do not build any Rust code, the plug-in should do nothing rather than failing the whole scan:

% csmock -at clippy -r rhel-7-x86_64 -f units-2.01-5.el7_9.src.rpm
[...]
>>> 2024-05-28 12:24:21 "set -o pipefail; /usr/share/csmock/scripts/convert-clippy.py < /tmp/csmocknsbuwvil/units-2.01-5.el7_9/debug/raw-results/builddir/clippy-output.txt | csgrep --remove-duplicates > /tmp/csmocknsbuwvil/units-2.01-5.el7_9/debug/uni-results/clippy-capture.err"
/bin/sh: line 1: /tmp/csmocknsbuwvil/units-2.01-5.el7_9/debug/raw-results/builddir/clippy-output.txt: No such file or directory

!!! 2024-05-28 12:24:21 error: post-process hook failed

Fixes: commit d216903
Related: https://issues.redhat.com/browse/OSH-30

@kdudka kdudka requested a review from lzaoral May 28, 2024 12:01
@kdudka kdudka self-assigned this May 28, 2024
kdudka added a commit to kdudka/csmock that referenced this pull request May 28, 2024
We want to enable `clippy` in the default scanning profile in a way that
it takes an effect for packages that build Rust code.  For packages that
do not build any Rust code, the plug-in should do nothing rather than
failing the whole scan:
```
% csmock -at clippy -r rhel-7-x86_64 -f units-2.01-5.el7_9.src.rpm
[...]
>>> 2024-05-28 12:24:21 "set -o pipefail; /usr/share/csmock/scripts/convert-clippy.py < /tmp/csmocknsbuwvil/units-2.01-5.el7_9/debug/raw-results/builddir/clippy-output.txt | csgrep --remove-duplicates > /tmp/csmocknsbuwvil/units-2.01-5.el7_9/debug/uni-results/clippy-capture.err"
/bin/sh: line 1: /tmp/csmocknsbuwvil/units-2.01-5.el7_9/debug/raw-results/builddir/clippy-output.txt: No such file or directory

!!! 2024-05-28 12:24:21 error: post-process hook failed
```

Fixes: commit d216903
Related: https://issues.redhat.com/browse/OSH-30
Closes: csutils#169
py/plugins/clippy.py Show resolved Hide resolved
We want to enable `clippy` in the default scanning profile in a way that
it takes an effect for packages that build Rust code.  For packages that
do not build any Rust code, the plug-in should do nothing rather than
failing the whole scan:
```
% csmock -at clippy -r rhel-7-x86_64 -f units-2.01-5.el7_9.src.rpm
[...]
>>> 2024-05-28 12:24:21 "set -o pipefail; /usr/share/csmock/scripts/convert-clippy.py < /tmp/csmocknsbuwvil/units-2.01-5.el7_9/debug/raw-results/builddir/clippy-output.txt | csgrep --remove-duplicates > /tmp/csmocknsbuwvil/units-2.01-5.el7_9/debug/uni-results/clippy-capture.err"
/bin/sh: line 1: /tmp/csmocknsbuwvil/units-2.01-5.el7_9/debug/raw-results/builddir/clippy-output.txt: No such file or directory

!!! 2024-05-28 12:24:21 error: post-process hook failed
```

Fixes: commit d216903
Related: https://issues.redhat.com/browse/OSH-30
Closes: csutils#169
Copy link
Member

@lzaoral lzaoral left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you @kdudka!

@kdudka
Copy link
Member Author

kdudka commented May 29, 2024

@lzaoral Thanks for review!

@kdudka kdudka closed this in 76a7d65 May 29, 2024
@kdudka kdudka deleted the clippy-no-rust branch May 29, 2024 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants