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

refactor: make suppression action generic via trait #2955

Merged
merged 1 commit into from
May 24, 2024

Conversation

ematipico
Copy link
Member

Summary

The suppression action system was tied to the JS language.

This refactors the system by making it generic using a trait called SuppressionAction inside biome_analyze.

Users will need to implement two functions:

  • the function that returns ApplySuppression, which contains info on where and how to apply the mutation
  • the function that actually adds the suppression comment in the right place

The CSS and JSON languages don't have suppression actions at this time.

The idea is to land a PR that applies suppression to CSS lint rules. @togami2864 I think we need to land at least a basic heuristic to apply suppression comments; otherwise, people won't see the "Quick fix" tooltip in the IDEs/editors.

Test Plan

The current CI should work.

@github-actions github-actions bot added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages L-CSS Language: CSS L-JSON Language: JSON and super languages labels May 23, 2024
@ematipico ematipico requested review from a team May 23, 2024 10:15
@ematipico ematipico force-pushed the refactor/make-suppression-action-generic branch from 13fe007 to 29be069 Compare May 23, 2024 10:26
Copy link

codspeed-hq bot commented May 23, 2024

CodSpeed Performance Report

Merging #2955 will not alter performance

Comparing refactor/make-suppression-action-generic (29be069) with main (af70ac2)

Summary

✅ 92 untouched benchmarks

@ematipico ematipico merged commit 8d1da58 into main May 24, 2024
15 checks passed
@ematipico ematipico deleted the refactor/make-suppression-action-generic branch May 24, 2024 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Linter Area: linter L-CSS Language: CSS L-JavaScript Language: JavaScript and super languages L-JSON Language: JSON and super languages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant