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

chore: apply clippy's suggetions #841

Closed
wants to merge 6 commits into from
Closed

Conversation

SobhanMP
Copy link
Contributor

I think it's sometimes helpful to use Clippy to avoid common mistakes. Unfortunately, this repo generates way too many of these.

The only one I could not figure out was

#[allow(clippy::ptr_arg)]
fn get_bytes_offset(lines: &Vec<&str>)

This commit is not supposed to change any behavior whatsoever.

@SobhanMP SobhanMP changed the title chores: apply clippy's suggetions chore: apply clippy's suggetions Aug 31, 2024
@baszalmstra
Copy link
Collaborator

Thats strange since we run clippy in CI! Would you be able to figure out why these werent caught and adapt the workflow so we catch these things earlier in the future?

@SobhanMP
Copy link
Contributor Author

I think that precommit only runs clippy on changed files

@SobhanMP
Copy link
Contributor Author

but then precommit doesn't run clippy

@baszalmstra
Copy link
Collaborator

We run clippy here:

- name: Run clippy

@SobhanMP
Copy link
Contributor Author

yeah, that's what i realized

@SobhanMP
Copy link
Contributor Author

i think we need to run it with cargo clippy -- -D warnings so that the job fails on warnings

@baszalmstra
Copy link
Collaborator

We are because of:

RUSTFLAGS: "-D warnings"

@baszalmstra
Copy link
Collaborator

Which version of rust are you using?

We are still using 1.75.0 which is pinned through the rust-toolchain file. Are you perhaps using a higher version?

@SobhanMP
Copy link
Contributor Author

rustc --version
rustc 1.80.1 (3f5fd8dd4 2024-08-06)

Ah

@baszalmstra
Copy link
Collaborator

I assume you are not using pixi or rustup? How did you install the rust compiler?

@SobhanMP
Copy link
Contributor Author

rustup?

@SobhanMP
Copy link
Contributor Author

SobhanMP commented Sep 2, 2024

ps. https://releases.rs/ show that 1.80 is stable

@SobhanMP
Copy link
Contributor Author

SobhanMP commented Sep 2, 2024

maybe it's a good idea to bump https://github.com/conda/rattler/blob/c02c9926318867fc61f25cb247588ae24263f9cb/rust-toolchain? or not setting it so it always stays at stable

@baszalmstra
Copy link
Collaborator

maybe it's a good idea to bump c02c992/rust-toolchain? or not setting it so it always stays at stable

We want to pin the rust compiler version because otherwise every time a new version comes out we have a lot of clippy warnings (exactly what you ran into). Bumping it is a good idea, this is already happening in #837

@baszalmstra
Copy link
Collaborator

#837 has been merged which bumps the rust toolchain to 1.80.0. This introduces a number of conflicts. Can you check if there are still missing clippy warnings?

@SobhanMP SobhanMP closed this Sep 3, 2024
@SobhanMP
Copy link
Contributor Author

SobhanMP commented Sep 3, 2024

Yep, every thing looks good!

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