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

cargo: Switch to workspace lints #1299

Merged
merged 14 commits into from
Dec 4, 2023
Merged

cargo: Switch to workspace lints #1299

merged 14 commits into from
Dec 4, 2023

Conversation

lexnv
Copy link
Collaborator

@lexnv lexnv commented Dec 1, 2023

In this PR, the recommended rust best practices are followed (since rust 1.74.0):

  • declares the lints at the workspace level.

  • remove a couple of lints that are now declared as unstable.

  • the optimization profile of the light-client is moved at the root level

@lexnv lexnv requested a review from a team as a code owner December 1, 2023 12:20
Copy link
Member

@niklasad1 niklasad1 left a comment

Choose a reason for hiding this comment

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

Can you bump the rust-version to v1.74.0 in the workspace Cargo.toml as well?

Otherwise, it looks good to me and nice to re-use the lints between the crates in subxt.

Cargo.toml Outdated
while_true = "deny"
trivial_casts = "deny"
trivial_numeric_casts = "deny"
unused_crate_dependencies = "deny"
Copy link
Member

Choose a reason for hiding this comment

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

I suggest that we remove these unused crate lints and use cargo machete instead

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I like this a lot! Already discovered few unused crates, with the tradeoff of some false-positive subxt dependency used by our build.rs for the testing crate! Have also added a CI step for it!

@lexnv lexnv requested a review from a team as a code owner December 1, 2023 15:06
Copy link
Member

@niklasad1 niklasad1 left a comment

Choose a reason for hiding this comment

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

nice 💪

lexnv added 2 commits December 1, 2023 17:31
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
Copy link
Contributor

@tadeohepperle tadeohepperle left a comment

Choose a reason for hiding this comment

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

This is nice!

@lexnv lexnv merged commit 14b7127 into master Dec 4, 2023
@lexnv lexnv deleted the lexnv/lints branch December 4, 2023 11:07
tadeohepperle added a commit that referenced this pull request Dec 4, 2023
* subxt: Remove unstable lints that cause compile warnings

Signed-off-by: Alexandru Vasile <[email protected]>

* cargo: Switch to workspace lints

Signed-off-by: Alexandru Vasile <[email protected]>

* cargo: Fix codec package at root level

Signed-off-by: Alexandru Vasile <[email protected]>

* cargo: Move profiles to the root level

Signed-off-by: Alexandru Vasile <[email protected]>

* Fix lightclient and metadata crates

Signed-off-by: Alexandru Vasile <[email protected]>

* Revert "cargo: Fix codec package at root level"

This reverts commit cdf9e16.

* Fix complexity clippy

Signed-off-by: Alexandru Vasile <[email protected]>

* cargo: Remove lints to be replaced by `cargo machete`

Signed-off-by: Alexandru Vasile <[email protected]>

* cargo: Remove unused dependencies (detected by machete)

Signed-off-by: Alexandru Vasile <[email protected]>

* ci: Add machete step

Signed-off-by: Alexandru Vasile <[email protected]>

* cargo: Bump rust version

Signed-off-by: Alexandru Vasile <[email protected]>

* ci: Rename machete step

Signed-off-by: Alexandru Vasile <[email protected]>

* ci: Rename cargo machete step

Signed-off-by: Alexandru Vasile <[email protected]>

---------

Signed-off-by: Alexandru Vasile <[email protected]>
jsdw pushed a commit that referenced this pull request Dec 6, 2023
…or` (#1306)

* cargo: Switch to workspace lints (#1299)

* subxt: Remove unstable lints that cause compile warnings

Signed-off-by: Alexandru Vasile <[email protected]>

* cargo: Switch to workspace lints

Signed-off-by: Alexandru Vasile <[email protected]>

* cargo: Fix codec package at root level

Signed-off-by: Alexandru Vasile <[email protected]>

* cargo: Move profiles to the root level

Signed-off-by: Alexandru Vasile <[email protected]>

* Fix lightclient and metadata crates

Signed-off-by: Alexandru Vasile <[email protected]>

* Revert "cargo: Fix codec package at root level"

This reverts commit cdf9e16.

* Fix complexity clippy

Signed-off-by: Alexandru Vasile <[email protected]>

* cargo: Remove lints to be replaced by `cargo machete`

Signed-off-by: Alexandru Vasile <[email protected]>

* cargo: Remove unused dependencies (detected by machete)

Signed-off-by: Alexandru Vasile <[email protected]>

* ci: Add machete step

Signed-off-by: Alexandru Vasile <[email protected]>

* cargo: Bump rust version

Signed-off-by: Alexandru Vasile <[email protected]>

* ci: Rename machete step

Signed-off-by: Alexandru Vasile <[email protected]>

* ci: Rename cargo machete step

Signed-off-by: Alexandru Vasile <[email protected]>

---------

Signed-off-by: Alexandru Vasile <[email protected]>

* test and outer enum pre compute

* explicit OuterEnumHashes type

* clippy

* move outer enums to their own module

---------

Signed-off-by: Alexandru Vasile <[email protected]>
@jsdw jsdw mentioned this pull request Dec 7, 2023
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.

3 participants