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: add support for configuration error severities in analysis_options.yaml #326

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

Artur-Wisniewski
Copy link

Closes issue: ISSUE-323

Now it is possible to override error severities from analysis_options.yaml using the errors parameter inside custom_lint

You should be able to do this:

custom_lint:
  errors:
    some_lint_with_info_severity: error

All of the some_lint_with_info_severity lint's error messages will be shown as errors by the analyzer

Copy link

vercel bot commented Mar 27, 2025

@Artur-Wisniewski is attempting to deploy a commit to the Invertase Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

docs-page bot commented Mar 27, 2025

To view this pull requests documentation preview, visit the following URL:

docs.page/invertase/dart_custom_lint~326

Documentation is deployed and generated using docs.page.

@rrousselGit
Copy link
Collaborator

Thanks for this!

Those tests are a bit too tied to the implementation details for my liking. Could you write e2e tests instead?

Like running dart run custom_lint and verify that the console flags a diagnostic as WARNING instead of INFO.

@Artur-Wisniewski
Copy link
Author

Thanks for this!

Those tests are a bit too tied to the implementation details for my liking. Could you write e2e tests instead?

Like running dart run custom_lint and verify that the console flags a diagnostic as WARNING instead of INFO.

Hello @rrousselGit 👋🏻
I've managed to add some additional tests for this task. (packages/custom_lint/test/analysis_options_test.dart)
If I understand correctly, these should be counted as e2e tests.

Please don't hesitate to let me know if there is anything else you need here.

@@ -83,4 +83,72 @@ void main() {
},
);
});

test('Respects configSeverities when converting errors', () {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Isn't this covered by the previous tests? I'd rather not have tests that are so tied to the implementation details.

Copy link
Author

@Artur-Wisniewski Artur-Wisniewski Mar 30, 2025

Choose a reason for hiding this comment

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

You're right. I will remove this test because it isn't needed here, and as you said, it is too much tied to the implementation details (now I see it).

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.

2 participants