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

Add ratio-simplified rule #7493

Open
FloEdelmann opened this issue Jan 23, 2024 · 1 comment
Open

Add ratio-simplified rule #7493

FloEdelmann opened this issue Jan 23, 2024 · 1 comment
Labels
status: needs discussion triage needs further discussion

Comments

@FloEdelmann
Copy link
Member

What is the problem you're trying to solve?

aspect-ratio: 3 / 4 is the same as aspect-ratio: 6 / 8, but if they are inconsistent in the codebase, it's difficult to find them both with a single search.

Note that 0.75 is also equivalent, but there is already another rule suggestion for choosing between integers and decimal style:

What solution would you like to see?

A new rule ration-simplified that reports 6 / 8 because it can be simplified to 3 / 4 because both numerator and the denominator are divisible by 2 (i.e. greatest common divisor is not 1). See also https://stackoverflow.com/questions/7777142/how-to-simplify-a-fraction.

@ybiquitous
Copy link
Member

ybiquitous commented Jan 24, 2024

@FloEdelmann Thanks for the proposal. I'm unsure how many use cases there are, but I can understand your argument.

Probably, I guess it matters whether this new rule is "generally useful; not tied to idiosyncratic patterns" as our document says.

I'd like to hear other members' thoughts.

@ybiquitous ybiquitous added the status: needs discussion triage needs further discussion label Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs discussion triage needs further discussion
Development

No branches or pull requests

2 participants