-
Notifications
You must be signed in to change notification settings - Fork 54
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 support for severity levels for warnings and errors #527
Conversation
Since we don't have different severity level in our checks currently I have not added any tests. After this PR is merged #518 (some strange issue has appeared), we can add tests with multiple severity levels. |
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
aa03633
to
eac393c
Compare
PR has been updated with feature tests. |
For me it seems correct. Where do we put the severity in check? I'd update some documentation in the plugin about severity levels. |
For sniffer rules, we can assign severity like this in
For other type of check like
In this example, For checks which are extended from
|
Currently several readme warnings are kept under same error code |
I think they are all Warnings. |
Thanks Nilambar, you have solved the conflicts and we have now new argument for severity. |
What about the suggestion at #479 (comment) to have separate severity levels for warnings and errors |
PR updated with feature tests and also with separate severity arguments. |
Why did you separate the severity? I undestood that 0-5 is warning, and 6-10 is error. After that, we have different severity levels. I think is less complicated. |
This was suggested at #479 (comment) let‘s discuss it there seperate levels brings more flexibility |
This is not the approach this PR has implemented. Since our significant checks used PHPCS, it'd better we follow the similar approach it follows. |
Ok |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me but would appreciate more reviews.
Ok, I ping to others. |
Look great. I agree keeping separate levels for warnings and errors for that extra bit of flexibility. For plugin repo specific checks, we'll have an extra look afterward if all levels are the way we like, but that's non-blocking for this PR. |
Perfect! |
Fixes #479
5
--severity
argument is added forwp plugin check
Example: