[ checkstyle-Feature Requests-3300836 ] new check: AbbreviationAsWordInTypeNameCheck

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[ checkstyle-Feature Requests-3300836 ] new check: AbbreviationAsWordInTypeNameCheck

SourceForge.net
Feature Requests item #3300836, was opened at 2011-05-11 21:19
Message generated for change (Comment added) made by romanivanov
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397081&aid=3300836&group_id=29721

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Check
Group: None
Status: Open
Priority: 5
Private: No
Submitted By: Roman Ivanov (romanivanov)
Assigned to: Nobody/Anonymous (nobody)
Summary: new check: AbbreviationAsWordInTypeNameCheck

Initial Comment:
Example: XMLReader should be names like XmlReader.
JShell name is ok - but JavaShell for some group of developers is preferable variant and they want to forbid "JShell" to stress distance from java api or standard classes (JPane , J.......).

Check name of the type to varidate abbreviations in capital letters.  
Rule is simple: allowedCapitalCounts+1 and more capital character in sequence in name is not allowed.

Basic Options: extend AbbreviationAsWordInTypeNameCheck from TypeNameCheck

Option: int allowedCapitalCounts; //default is 2
Option: String ignoreNames; // will be regexp for exceptions in rules

We need to have ignore list to allow user to cover whole code by this rule, and do Name refactoring gradual for existing code. Some names are very hard to change (they are part of API or any other contract), so ignore list of names is vital.

----------------------------------------------------------------------

>Comment By: Roman Ivanov (romanivanov)
Date: 2012-04-18 20:47

Message:
>> int allowedCapitalCounts; //default is 2
This option the only reason, and only this option helped to reconsile
disputes about naming of the classes in our company. With regular
expression there was too much exceptions. Without this option we can not
switch this check at all.

----------------------------------------------------------------------

Comment By: Oliver Burn (oburn)
Date: 2012-04-16 03:38

Message:
Why not use a regular expression to handle preventing capital letters -
e.g. "^[A-Z]([a-z0-9][A-Z]?)*$".

To allow for exceptions, add them to the regular expression - e.g.
"^[A-Z]([a-z0-9][A-Z]?)*$|^JPanel$"

----------------------------------------------------------------------

Comment By: Daniil Yaroslavtsev (daniilyar)
Date: 2012-04-09 10:47

Message:
Done.
Patch is here:
https://sourceforge.net/tracker/?func=detail&aid=3516175&group_id=29721&atid=397080


----------------------------------------------------------------------

Comment By: Roman Ivanov (romanivanov)
Date: 2011-06-27 11:13

Message:
We need the same check for name of methods and fields and even variables.

----------------------------------------------------------------------

Comment By: Roman Ivanov (romanivanov)
Date: 2011-05-13 11:22

Message:
We need to consider allowedCapitalCounts=3 by default because small
Abbreviations does not looks good IoException  - IOException is better

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397081&aid=3300836&group_id=29721

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Checkstyle-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-devel
Loading...