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

Fixed clippy warnings and spelling #1881

Merged
merged 6 commits into from
Sep 19, 2023

Conversation

DariuszDepta
Copy link
Member

No description provided.

Copy link
Collaborator

@chipshort chipshort left a comment

Choose a reason for hiding this comment

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

Looks good, I just want to propose two changes

packages/go-gen/src/schema.rs Outdated Show resolved Hide resolved
packages/std/src/testing/mock.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@chipshort chipshort left a comment

Choose a reason for hiding this comment

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

LGTM

@DariuszDepta DariuszDepta merged commit 6d3f9b0 into main Sep 19, 2023
3 checks passed
@DariuszDepta DariuszDepta deleted the fixing-clippy-warnings-and-spellings branch September 19, 2023 12:54
@webmaster128
Copy link
Member

How did you get those clippy warnings? Why does our CI not catch them? Is it due to new rules?

@DariuszDepta
Copy link
Member Author

My scenario is usually as follows:

Checking installed toolchains, make sure nighty is there

$ rustup show

Update Rust to newest version

$ rustup update

Run clippy

$ cargo +nightly clippy [--workspace] [--features] --all-targets

This way clippy is newest, and checks also test cases and benchmarks.

The risk is, that after fixing clippy warnings in newest Rust version, the older version may not compile the code.
After applying the changes, building the project using older compiler must be done. And this is done on CI.

So I have catched these warnings because of new rules I guess in newest nightly version of Rust compiler.

@webmaster128
Copy link
Member

I see, thanks. The thing I wanted to point out is that we should ensure the upper version from

rust-version: ["1.67.0", "1.72.0"]
is bumped along with clippy fixes. This ensure the codebase remains compliant with the latest stable Rust. But then it seems like you fixed rules that are not in stable yet in this PR.

@DariuszDepta
Copy link
Member Author

DariuszDepta commented Sep 21, 2023

In this PR there are no unstable features fixes, the code compiles with Rust version defined in CI.
In the future I will stick to clippy warnings reported by the last stable Rust version as defined in CI:

  clippy:
    parameters:
      rust-version:
        type: string
    docker:
      # In this job we use the latest Rust stable in order to check against the
      # most recent code style recommendations.
      - image: rust:<< parameters.rust-version >>

Thanks for pointing out, such procedure could accidentally lead to compilation problems. Thanks again!

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