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

feat(biome_css_analyze): implement noDescendingSpecificity #4097

Merged
merged 23 commits into from
Sep 30, 2024

Conversation

tunamaguro
Copy link
Contributor

Summary

Implement noDescendingSpecificity and the specificity calculation
close #2810

Test Plan

Added tests and snapshots

@github-actions github-actions bot added A-Project Area: project A-Linter Area: linter L-CSS Language: CSS A-Diagnostic Area: diagnostocis labels Sep 26, 2024
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this rule takes the entire file into account, I think it would be better to split these tests into multiple files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it would be better that way as you said, so I split it at da0b219

Copy link

codspeed-hq bot commented Sep 26, 2024

CodSpeed Performance Report

Merging #4097 will degrade performances by 6.65%

Comparing tunamaguro:impl-noDescendingSpecificity (ae6f6f3) with main (011a709)

Summary

❌ 3 (👁 3) regressions
✅ 98 untouched benchmarks

Benchmarks breakdown

Benchmark main tunamaguro:impl-noDescendingSpecificity Change
👁 css_analyzer[bootstrap_18416142857265205439.css] 200.6 ms 214.9 ms -6.65%
👁 css_analyzer[bulma_5641719244145477318.css] 638.5 ms 679.8 ms -6.07%
👁 css_analyzer[tachyons_11778168428173736564.css] 111.4 ms 118.9 ms -6.27%

@tunamaguro
Copy link
Contributor Author

Thank you for your review.
I have made the corrections you pointed out. Could you please check it again?

Comment on lines 190 to 193
//
// Read our guidelines to write great diagnostics:
// https://docs.rs/biome_analyze/latest/biome_analyze/#what-a-rule-should-say-to-the-user
//
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove this comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed at 0dbdbd1

@tunamaguro
Copy link
Contributor Author

Thank you for your review.
I have made the corrections you pointed out. Could you please check it again?

Also, I noticed that the performance test in the CI is failing with my PR. But I'm not sure where to make the necessary changes as I lack knowledge. Could you please help me with this?

Copy link
Contributor

@togami2864 togami2864 left a comment

Choose a reason for hiding this comment

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

Given that the rule is applied to almost all selectors, I thought this regression was acceptable. Or it's ok to address it in a separate PR.

@chansuke @ematipico @dyc3 any thoughts?

@ematipico
Copy link
Member

Yeah, the regression seems acceptable to me too!

@ematipico ematipico merged commit 295efb9 into biomejs:main Sep 30, 2024
12 checks passed
branberry pushed a commit to branberry/biome that referenced this pull request Sep 30, 2024
@Conaclos Conaclos added the A-Changelog Area: changelog label Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Changelog Area: changelog A-Diagnostic Area: diagnostocis A-Linter Area: linter A-Project Area: project L-CSS Language: CSS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

📎 Implement stylelint/no-descending-specificity
6 participants