rust-clippy icon indicating copy to clipboard operation
rust-clippy copied to clipboard

unused or incorrect lints in Cargo.toml fail silently

Open clayrab opened this issue 1 year ago • 2 comments

Summary

Adding this section to Cargo.toml produces no errors or warnings:

[lints.clippy]
asdf = "deny"

I'm trying to do this:

[lints.clippy]
blocks_in_conditions = "allow"

I believe this isn't supported, but can't be sure becuase it produces no errors.

The same setting in clippy.toml blows up, which is what I'd expect to see if it's done via Cargo.toml as well:

  --- stderr
  error: error reading Clippy's configuration file: unknown field `blocks_in_conditions`, expected one of
             absolute-paths-allowed-crates             avoid-breaking-exported-api              future-size-threshold                       standard-macro-braces
             absolute-paths-max-segments               await-holding-invalid-types              ignore-interior-mutability                  struct-field-name-threshold
             accept-comment-above-attributes           blacklisted-names                        large-error-threshold                       suppress-restriction-lint-in-const
             accept-comment-above-statement            cargo-ignore-publish                     literal-representation-threshold            third-party
             allow-dbg-in-tests                        check-private-items                      matches-for-let-else                        too-large-for-stack
             allow-expect-in-tests                     cognitive-complexity-threshold           max-fn-params-bools                         too-many-arguments-threshold
             allow-mixed-uninlined-format-args         cyclomatic-complexity-threshold          max-include-file-size                       too-many-lines-threshold
             allow-one-hash-in-raw-strings             disallowed-macros                        max-struct-bools                            trivial-copy-size-limit
             allow-print-in-tests                      disallowed-methods                       max-suggested-slice-pattern-length          type-complexity-threshold
             allow-private-module-inception            disallowed-names                         max-trait-bounds                            unnecessary-box-size
             allow-unwrap-in-tests                     disallowed-types                         min-ident-chars-threshold                   unreadable-literal-lint-fractions
             allowed-dotfiles                          doc-valid-idents                         missing-docs-in-crate-items                 upper-case-acronyms-aggressive
             allowed-idents-below-min-chars            enable-raw-pointer-heuristic-for-send    msrv                                        vec-box-size-threshold
             allowed-scripts                           enforce-iter-loop-reborrow               pass-by-value-size-limit                    verbose-bit-mask-threshold
             arithmetic-side-effects-allowed           enforced-import-renames                  semicolon-inside-block-ignore-singleline    warn-on-all-wildcard-imports
             arithmetic-side-effects-allowed-binary    enum-variant-name-threshold              semicolon-outside-block-ignore-multiline    
             arithmetic-side-effects-allowed-unary     enum-variant-size-threshold              single-char-binding-names-threshold         
             array-size-threshold                      excessive-nesting-threshold              stack-size-threshold                        
   --> /Users/clay/projects/evm/clippy.toml:3:1 

Reproducer

I tried this code:

<code>

I expected to see this happen:

Instead, this happened:

Version

No response

Additional Labels

No response

clayrab avatar Jan 11 '24 03:01 clayrab