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

Enable clippy --all-features on CI #1744

Closed
wants to merge 11 commits into from
Closed

Enable clippy --all-features on CI #1744

wants to merge 11 commits into from

Conversation

rozhkovdmitrii
Copy link

@rozhkovdmitrii rozhkovdmitrii commented Apr 4, 2023

#1745
There were a lot of warning if cargo clippy --all-features -- -D warnings is started to check. These warnings have been suppressed meanwhile with cfg(test)

@laruh laruh requested review from laruh and onur-ozkan April 4, 2023 09:07
laruh
laruh previously approved these changes Apr 4, 2023
Copy link
Member

@laruh laruh left a comment

Choose a reason for hiding this comment

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

LGTM!

@onur-ozkan
Copy link
Member

Instead of ignoring the warnings, I was expecting to apply what clippy says just like we did in #1699 for all other modules other than solana.

--

please check the warnings with --all-targets flag cargo clippy --all-targets --all-features -- -D warnings. You might miss some warnings without it.

@laruh
Copy link
Member

laruh commented Apr 4, 2023

please check the warnings with --all-targets flag cargo clippy --all-targets --all-features -- -D warnings. You might miss some warnings without it.

As we missed warnings in dev, I suggest changing the cargo clippy -- -D warnings command to cargo clippy --all-targets --all-features -- -D warnings in contributing file. The whole project should be clean, without warnings.

@onur-ozkan
Copy link
Member

It was cargo clippy -- -D warnings on previous CI stack. In current stack it's cargo clippy --all-targets -- -D warnings, once we have --all-features working without warnings I will update that too.

rozhkovdmitrii added 2 commits April 4, 2023 16:12
@rozhkovdmitrii
Copy link
Author

rozhkovdmitrii commented Apr 4, 2023

Instead of ignoring the warnings, I was expecting to apply what clippy says just like we did in #1699 for all other modules other than solana.

--

please check the warnings with --all-targets flag cargo clippy --all-targets --all-features -- -D warnings. You might miss some warnings without it.

  1. That is not ignoring, as you can see the majority of warnings are "unused", but those are actually test related methods, that is why these three modules should be marked as test related

  2. If the command --all-targets flag cargo clippy --all-targets --all-features -- -D warnings is used it would reveal a bit variety of warnings and even the code that can not be compiled. If you want to solve all the legacy artifacts it would be reasonable to perform it not in one huge PR but in a few from organizational point of view

  3. These test are even not able to be compiled ) cargo test --no-run --features=enable-solana --release, abandoned

I think solana related problems should be solved apart, like the other groups of proplems
What do you thing? @ozkanonur

@rozhkovdmitrii
Copy link
Author

rozhkovdmitrii commented Apr 4, 2023

Instead of ignoring the warnings, I was expecting to apply what clippy says just like we did in #1699 for all other modules other than solana.

--

please check the warnings with --all-targets flag cargo clippy --all-targets --all-features -- -D warnings. You might miss some warnings without it.

  1. That is not ignoring, as you can see the majority of warnings are "unused", but those are actually test related methods, that is why these three modules should be marked as test related

  2. If the command cargo clippy --all-targets --all-features -- -D warnings is used it would reveal a big variety of warnings and even the code that can not be compiled. If you want to solve all the legacy artifacts it would be reasonable to perform it not in one huge PR but in a few from organizational point of view

  3. These test are not able to be compiled ) cargo test --no-run --features=enable-solana --release

I think solana related problems should be solved apart, like the other groups of proplems
What do you thing? @ozkanonur

@rozhkovdmitrii rozhkovdmitrii reopened this Apr 4, 2023
@rozhkovdmitrii rozhkovdmitrii changed the title solana - get rid of clippy warnings WIP: solana - get rid of clippy warnings Apr 4, 2023
@onur-ozkan
Copy link
Member

That is not ignoring, as you can see the majority of warnings are "unused", but those are actually test related methods, that is why these three modules should be marked as test related

Yeah I see, test modules can be stay with test attribute.

If the command --all-targets flag cargo clippy --all-targets --all-features -- -D warnings is used it would reveal a bit variety of warnings and even the code that can not be compiled. If you want to solve all the legacy artifacts it would be reasonable to perform it not in one huge PR but in a few from organizational point of view

That's the idea. You will be able to see wasm warnings with providing --all-targets. I had to fix ~500 warnings because of that. And some of them were even critical.

These test are not able to be compiled ) cargo test --no-run --features=enable-solana --release

I couldn't get what you mean here

@rozhkovdmitrii
Copy link
Author

rozhkovdmitrii commented Apr 4, 2023

I couldn't get what you mean here

Checked it up again, build perfect, thank you.

@rozhkovdmitrii rozhkovdmitrii changed the title WIP: solana - get rid of clippy warnings Solana - get rid of clippy warnings Apr 4, 2023
@laruh laruh linked an issue Apr 4, 2023 that may be closed by this pull request
@rozhkovdmitrii rozhkovdmitrii changed the title Solana - get rid of clippy warnings Enable clippy --all-features on CI Apr 19, 2023
@rozhkovdmitrii
Copy link
Author

Created new PR #1760

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.

Running clippy with --all-features results in a set of warnings
3 participants