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

Clippy fixes #140

Merged
merged 5 commits into from
Oct 25, 2024
Merged

Clippy fixes #140

merged 5 commits into from
Oct 25, 2024

Conversation

asibahi
Copy link
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
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
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
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
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
Collaborator

Looks good. Will wait for someone to merged it.

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