Skip to content

Fix/pre commit and clippy - #257

Open
chifflier wants to merge 8 commits into
masterfrom
fix/pre-commit-and-clippy
Open

Fix/pre commit and clippy#257
chifflier wants to merge 8 commits into
masterfrom
fix/pre-commit-and-clippy

Conversation

@chifflier

Copy link
Copy Markdown
Member

QA+CI improvements:

  • add pre-commit configuration (I use prek which is compatible but faster) to run hooks locally on commits
  • check the same hooks in CI
  • centralize lints (rust and clippy) in Cargo.toml and enable more warnings
  • fix all warnings and/or add bypasses in tests and examples

@chifflier
chifflier requested a review from cpu August 6, 2026 14:33

@cpu cpu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Seems OK if you like pre-commit hooks :-)

I had some nits to consider but nothing I consider blocking. Thanks!

Comment thread .github/workflows/rust.yml
Comment thread Cargo.toml
hex-literal = "0.4"

[lints.clippy]
#pedantic = { level = "warn", priority = -1 }

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why land commented-out config? I think it'd be tidier to remove this and the other print_stdout/print_stderr entries if they're not being used.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

the objective is to un-comment them progressively. If we activate the warnings right now, there are a lot of fixes

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I understand not wanting to activate it immediately, but I don't know that I see the value in leaving it commented out as some kind of reminder. Wouldn't a GitHub issue be better for tracking the work required to enable pedantic clippy if that's a goal?

Comment thread Cargo.toml

[lints.rust]
unsafe_code = "forbid"
#missing_docs = "warn"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

same feedback to consider here RE: not adding commented out config.

uses: rusticata/ci-action-rdme@v1
uses: rusticata/ci-action-rdme@v2
with:
rdme-args: --intralinks-features validate,verify,verify-aws

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It'd make for a tidier commit history if this were folded into the commit that added the pre-commit config 👼

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It can be done, I just thought of these commits as slightly different (one for pre-commit and one for rdme) which could have been independant

Comment thread tests/readcsr.rs

assert!(rem.is_empty());
dbg!(csr.certification_request_info.attributes());
//dbg!(csr.certification_request_info.attributes());

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I would vote to remove this line instead of commenting it out.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

agreed, I will update

@chifflier

Copy link
Copy Markdown
Member Author

Seems OK if you like pre-commit hooks :-)

I had some nits to consider but nothing I consider blocking. Thanks!

Thanks for the review, I will push some updates then merge.
For the record: I usually do not really like pre-commit hooks, but I had several projects where I found them useful to catch errors before the CI. I think of these hooks as bonus (and optional)

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