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: Set up clippy to avoid creeping annotations #602

Merged
merged 8 commits into from
Aug 17, 2023

Conversation

huitseeker
Copy link
Member

  • cleans up clippy attributes we don't use, and use the facilities we already have (clippy.toml, .cargo/config) for the ones we do,
  • rejects casts for which there is a better (non-cast, safe) alternative.

samuelburnham
samuelburnham previously approved these changes Aug 13, 2023
@huitseeker huitseeker changed the title chore: Tune clippy chore: Set up clippy to avoid creeping annotations Aug 14, 2023
@huitseeker huitseeker force-pushed the tune_clippy branch 8 times, most recently from a4cb80d to f5c3ef6 Compare August 16, 2023 01:28
- Removed split linting warnings across multiple files, removing clippy::too_many_arguments allowances
- Modified the clippy lint settings, denying previously allowed lints, and used config to enforce prior behavior
This fires when there is a guaranteed lossless type conversion that could replace a cast.
- Corrected lifetime specifications in `BenchmarkGroup` for all benchmarking functions in `fibonacci.rs` and `synthesis.rs`.
- Added `-Wrust_2018_idioms` lint to the `xclippy` alias in the `.cargo` config, and removed thenredundant `rust_2018_idioms` from the deny lint attributes in the library root.
…e this with cargo

- Adds the `Eq` trait to derive macros a series of data structures across multiple files,
- Strictened linting rules by implementing a new clippy lint check for unpaired `PartialEq` and `Eq` derivations,
- Lint is designed to identify and flag instances of large types being passed by value
- Incorporates lint checks for specific behaviors including needless borrows, misuse of ok_or, and unused lifetimes.

chore: set up checked conversions lint
- Implement an update to the `to_string()` function usage in `init_lurk_state` for efficiency.
- Modify the creation of hex strings in `parse_unicode` for efficiency.
- Include `inefficient_to_string` lint checker
- Enhanced Rust's Clippy linting capabilities by adding four new lints: `filter_map_next`, `flat_map_option`, `map_flatten`, and `map_unwrap_or` in `.cargo/config` file.
@@ -1,3 +1,4 @@
type-complexity-threshold = 999
Copy link
Collaborator

Choose a reason for hiding this comment

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

😂

Copy link
Member Author

@huitseeker huitseeker Aug 17, 2023

Choose a reason for hiding this comment

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

As Bodil would say "I have the power of Oleg!"
(also, this is quite sedate, barely 4x the default)

@huitseeker huitseeker added this pull request to the merge queue Aug 17, 2023
Merged via the queue into argumentcomputer:master with commit 2ffa799 Aug 17, 2023
6 checks passed
@huitseeker huitseeker deleted the tune_clippy branch August 17, 2023 16:54
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.

3 participants