Skip to content

ci: add lint workflow#2

Merged
diefans merged 2 commits intomainfrom
add-lint-workflow
Apr 30, 2025
Merged

ci: add lint workflow#2
diefans merged 2 commits intomainfrom
add-lint-workflow

Conversation

@cakemanny
Copy link
Contributor

@cakemanny cakemanny commented Apr 30, 2025

It feels a bit naughty to have warnings show on the install, so I was thinking to add a lint check to prevent them for the case of future changes

RUSTFLAGS="-D unused" cargo check
warning: unused import: `ArgAction`
 --> src/main.rs:3:12
  |
3 | use clap::{ArgAction, Parser, Subcommand};
  |            ^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `std::str::FromStr`
  --> src/main.rs:12:5
   |
12 | use std::str::FromStr;
   |     ^^^^^^^^^^^^^^^^^

warning: `paseto-cli` (bin "paseto-cli") generated 2 warnings (run `cargo fix --bin "paseto-cli"` to apply 2 suggestions)

I found the way to do it in https://rust-unofficial.github.io/patterns/anti_patterns/deny-warnings.html

It does state that new warnings might pop up with new rust versions and deps, including deprecations so I figured RUSTFLAGS="-D all" cargo check might cause too much friction.
Maybe there are more to added... but I guess clippy has our back for most issues.

I feel it's nicer not to add it to the code because it gets in the way of iteration

@cakemanny cakemanny requested review from cl3m0, diefans and sofi-bm April 30, 2025 07:15
@diefans diefans merged commit 82a7b82 into main Apr 30, 2025
1 check passed
@diefans diefans deleted the add-lint-workflow branch April 30, 2025 11:58
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