The example libraries are separated into the following three categories:
- general - significant concerns; may produce false positives
- supplementary - lesser concerns, but with a low false positive rate
- restriction - lesser or stylistic concerns; may produce false positives (similar to Clippy's "restriction" category)
- testing - used only for testing purposes
Example | Description/check |
---|---|
await_holding_span_guard |
Span guards held while calling await inside an async function |
crate_wide_allow |
#![allow(...)] used at the crate level |
env_cargo_path |
env! applied to Cargo environment variables containing paths |
non_local_effect_before_error_return |
Non-local effects before return of an error |
non_thread_safe_call_in_test |
Non-thread-safe function calls in tests |
Example | Description/check |
---|---|
overscoped_allow |
allow attributes whose scope could be reduced |
redundant_reference |
Reference fields used only to read one copyable subfield |
unnecessary_conversion_for_trait |
Unnecessary trait-behavior-preserving calls |
Example | Description/check |
---|---|
collapsible_unwrap |
An unwrap that could be combined with an expect or unwrap using and_then |
const_path_join |
Joining of constant path components |
env_literal |
Environment variables referred to with string literals |
inconsistent_qualification |
Inconsistent qualification of module items |
misleading_variable_name |
Variables whose names suggest they have types other than the ones they have |
missing_doc_comment_openai |
A lint that suggests doc comments using OpenAI |
question_mark_in_expression |
The ? operator in expressions |
ref_aware_redundant_closure_for_method_calls |
A ref-aware fork of redundant_closure_for_method_calls |
suboptimal_pattern |
Patterns that could perform additional destructuring |
try_io_result |
The ? operator applied to std::io::Result |
Example | Description/check |
---|---|
clippy |
All of the Clippy lints as a Dylint library |
straggler |
A lint that uses an old toolchain for testing purposes |
Notes
- Each example is in its own workspace so that it can have its own
rust-toolchain
. - Each example is configured to use the installed copy of
dylint-link
. To use the copy within this repository, change the example's.cargo/config.toml
file as follows:[target.x86_64-unknown-linux-gnu] linker = "../../../target/debug/dylint-link"