-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Improve documentation - how to add usage of var
to check IllegalType
?
#14775
Comments
There is no "add to default" for properties. You would have to either redefine the defaults to add new illegals or create 2 instances of the check (default and specialized). @romani on approvals |
@rnveach Do I understand it correctly that
to add an additional check to the default check. |
no, we need to respect all peoples defaults. Some people like
the only option for now. We do not know how to make our configs to allow users to reference default values that are hardcoded in Check, may be in future we will find a way.
yes, please send PR , all doc is at https://github.com/checkstyle/checkstyle/blob/master/src/xdocs/checks/coding/illegaltype.xml.template , just and one more example with description. |
Yes, this is the same as adding to the default. It is just a forbid class list, so it shouldn't matter how much you split it up as long as each module instance has the other properties configured the same. |
Expressing what you want is always hard. I learned from this issue discussion |
Please improve our doc, I shared with you link to file that need a change. |
On #8978 (comment) is stated that checkstyle can report
var
usage as forbidden.The provide link is no longer working, yet on https://checkstyle.sourceforge.io/checks/coding/illegaltype.html I am unable to find any example related to the usage of
var
.I would like to add
var
to the default checks ofIllegalType
.I assume adding
<property name="illegalClassNames" value="var"/>
to theIllegalType
module will remove the default values.Is that indeed the case?
If so, how can I add
var
toillegalClassNames
without removing the default value?Of course, I can repeating the default value, but that has drawbacks:
Could the documentation be improved such that it is clearer how to add illegal class names to the default illegal class names.
Thanks in advance,
Pierre
The text was updated successfully, but these errors were encountered: