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/cd: Use clippy to ensure code quality #158

Merged
merged 1 commit into from
Jan 6, 2022
Merged

ci/cd: Use clippy to ensure code quality #158

merged 1 commit into from
Jan 6, 2022

Conversation

marhkb
Copy link
Collaborator

@marhkb marhkb commented Nov 14, 2021

No description provided.

@marhkb marhkb changed the title ci/cd: Use clippy to improve code quality ci/cd: Use clippy to ensure code quality Nov 14, 2021
@marhkb marhkb marked this pull request as ready for review November 14, 2021 13:43
@melix99
Copy link
Collaborator

melix99 commented Dec 16, 2021

The fact that the clippy CI is not running on flatpak can be problematic, this is why I haven't merged this yet. I wonder if we can use the same flatpak instance for also running clippy.

@marhkb marhkb marked this pull request as draft January 5, 2022 15:17
@marhkb
Copy link
Collaborator Author

marhkb commented Jan 5, 2022

The fact that the clippy CI is not running on flatpak can be problematic, this is why I haven't merged this yet. I wonder if we can use the same flatpak instance for also running clippy.

I took a look at pika to see how they solved it. When I tried to port their solution over, I realized that it doesn't run clippy in the end at all, neither here nor in their pipeline (https://gitlab.gnome.org/World/pika-backup/-/jobs/1706197). So this is never going to fail.

In order to make clippy run, I had to make a small correction. I plan to contribute that to pika.

Additionally, I had to pass -Dwarnings to clippy to treat warnings as errors. In this way, the pipeline will fail if clippy complains. The disadvantage is that only the first warning (error) will be printed before clippy returns an exit code. IIUC, this should be fixed with the next rust release (rust-lang/rust-clippy#1209 (comment)).

One last thing I could not solve is to make flatpak-builder download the rust sdk extension automatically. Unfortunately, my research here was without success.

@melix99
Copy link
Collaborator

melix99 commented Jan 5, 2022

One last thing I could not solve is to make flatpak-builder download the rust sdk extension automatically. Unfortunately, my research here was without success.

I think we need --install-deps-from=flathub.

@marhkb
Copy link
Collaborator Author

marhkb commented Jan 6, 2022

One last thing I could not solve is to make flatpak-builder download the rust sdk extension automatically. Unfortunately, my research here was without success.

I think we need --install-deps-from=flathub.

That was it! I found that I either had to add the repo to the user installation additionally or simply remove the --user flag to make it work.
This should be complete now.

@marhkb marhkb marked this pull request as ready for review January 6, 2022 13:29
@melix99 melix99 enabled auto-merge January 6, 2022 13:35
@melix99 melix99 merged commit a798918 into paper-plane-developers:main Jan 6, 2022
@marhkb marhkb deleted the clippy-ci branch January 7, 2022 10:38
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