GeezerVison is showing github.com — [java] CommentRequired: make property names consistent by snuyanzin · Pull Request #2069 · pmd/pmd
Conversation
The PR fixes #1683 by introducing a separate property for class comment and making header property checking only header top-level comments
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
ghost
commented
Oct 15, 2019
•
edited by ghost
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
1 Message
|
| 📖 |
This changeset introduces 6939 new violations, 0 new errors and 0 new configuration errors,
removes 6933 violations, 2 errors and 2 configuration errors.
Full report |
| ✅ |
This changeset introduces 6939 new violations, 0 new errors and 0 new configuration errors,
removes 6933 violations, 2 errors and 2 configuration errors.
Full report |
| ✅ |
This changeset introduces 14995 new violations, 0 new errors and 0 new configuration errors,
removes 6931 violations, 2 errors and 2 configuration errors.
Full report |
Generated by 🚫 Danger
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
I changed default value for headerCommentRequirement to reduce the number of violations in the report
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
Thanks for your PR!
Unfortunately, I don't think we can merge it as is: We should try to keep the change as backwards compatible as possible. This means:
- Introducing a new property for class comments ✅ - already done: "classCommentRequirement"
- Deprecate the property "headerCommentRequirement" - since this will be replaced by the correctly named "classCommentRequirement".
- You can achieve this by starting the property description with the string "Deprecated! ". Then it will be rendered in the documentation as deprecated.
- To make the change for the users easier, we should then
- log a deprecation warning, if this property is not the default (the default is, as before Required).
- If the new property is the default value but the old, deprecated property is not, then use the value of the old deprecated property. This is the case, if some user configured the rule using the deprecated property
- If the new property is not the default value, then we ignore the deprecated property value. The new property will be used. We would still log a warning, if the old deprecated property has a non-default value - because then the user configured both properties, which is wrong.
- We might introduce a new property "packageCommentRequired" in order to check for formal comments for packages. However, this is completely different:
- package javadoc comments are not in every file, but only in the file package-info.java
- if the file package-info.java doesn't exist, we won't analyze it, so we can't require this comment
- the only check we could do here is "Unwanted"
- So, I'm not sure, whether checking for package comments makes sense at all?
- IMHO header comments (such as license headers, ...) are not javadoc (
/** ... */) comments, but normal (/* ... */) comments. The rule however only checks for javadoc/formal comments. So, header comments are irrelevant for this rule.
- We should also improve the rule description: It currently talks about comments, which is not precise. We should clarify, that this rule only checks javadoc (formal) comments.
- Change the rule description in this file:
|
Denotes whether comments are required (or unwanted) for specific language elements. |
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
adangel
changed the title
[java][PMD-1683] Separate header comment from CommentRequired as class comm…
[java] CommentRequired: Renamed property headerCommentRequirement
Oct 19, 2019
adangel
changed the title
[java] CommentRequired: Renamed property headerCommentRequirement
[java] CommentRequired: Rename property headerCommentRequirement
Oct 19, 2019
adangel
changed the title
[java] CommentRequired: Rename property headerCommentRequirement
[java] CommentRequired: make property names consistent
Oct 19, 2019
…d header top-level comment
Refs pmd#1683
…ult, make tests more targeted
Refs pmd#1683
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|