Skip to content

Clippy fixes#140

Merged
khaledhosny merged 5 commits intoharfbuzz:mainfrom
asibahi:main
Oct 25, 2024
Merged

Clippy fixes#140
khaledhosny merged 5 commits intoharfbuzz:mainfrom
asibahi:main

Conversation

@asibahi
Copy link
Copy Markdown
Contributor

@asibahi asibahi commented Oct 24, 2024

The first commit contains a bulk of basic lints (avoiding double refs, needless returns, needless format!, and so on).

The other commits are divided by lint they apply.

@RazrFalcon
Copy link
Copy Markdown
Collaborator

collapsible if should probably be ignored. We try to match harfbuzz's code style when possible. So the code should look as close to harfbuzz as possible, at least in theory.

@alerque
Copy link
Copy Markdown
Member

alerque commented Oct 24, 2024

We can configure the lint to be ignored project wide if it is interfering with keeping the cognitive load low when comparing code bases.

Copy link
Copy Markdown
Contributor Author

@asibahi asibahi left a comment

Choose a reason for hiding this comment

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

These are the remaining lints. I wonder where a good place to add them would be:

// Quiet Clippy lints left to match hb style
#![allow(clippy::collapsible_if)]
#![allow(clippy::collapsible_else_if)]
#![allow(clippy::comparison_chain)]
#![allow(clippy::needless_range_loop)]
#![allow(clippy::non_canonical_partial_ord_impl)]
#![allow(clippy::doc_lazy_continuation)] // <-- this one is about docs, not code style
#![allow(clippy::upper_case_acronyms)]
#![allow(clippy::too_many_arguments)]
#![allow(clippy::wildcard_in_or_patterns)]
#![allow(clippy::identity_op)]
#![allow(clippy::mut_range_bound)]
#![allow(clippy::enum_variant_names)]
#![allow(clippy::manual_range_patterns)]
#![allow(clippy::type_complexity)]
#![allow(clippy::wrong_self_convention)]
#![allow(clippy::match_like_matches_macro)]

@RazrFalcon
Copy link
Copy Markdown
Collaborator

Looks fine to me, but let's also disallow (a..b).contains(&c). Since it's not available in C++. Should make porting easier.

@RazrFalcon
Copy link
Copy Markdown
Collaborator

Looks good. Will wait for someone to merged it.

@khaledhosny khaledhosny merged commit 20c75ad into harfbuzz:main Oct 25, 2024
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.

4 participants