Package names should comply with a naming convention (squid:S00120) and underscore

812 views
Skip to first unread message

j...@qsm.co.il

unread,
Dec 17, 2017, 3:38:23 PM12/17/17
to SonarLint
sonarlint for Java produces an error "Package names should comply with a naming convention (squid:S00120)" "With the default regular expression ^[a-z]+(.[a-z][a-z0-9])$". However the JLS allows and even recommends using the underscore. Clause 6.1. Declarations says, i.a., "If the domain name contains a hyphen, or any other special character not allowed in an identifier (§3.8), convert it into an underscore." 
One cannot comply with another clause in the JLS without the underscore: "You form a unique package name by first having (or belonging to an organization that has) an Internet domain name, such as oracle.com. You then reverse this name, component by component, ..., and use this as a prefix for your package names, using a convention developed within your organization to further administer package names." My domain is www.qsm-fss.com. So it cannot be bad style to have an underscore in a package name.

j...@qsm.co.il

unread,
Dec 17, 2017, 5:59:09 PM12/17/17
to SonarLint
I would like to add a quotation from the same item a posted to SO: "I would tell the sonarlint people to stop enforcing a different (tighter) constraint than what is specified in the JLS. They are 100% wrong to do so. – EJP."

jeanchrist...@sonarsource.com

unread,
Dec 18, 2017, 5:19:45 AM12/18/17
to SonarLint
Hello,

You are right, it was an oversight on our side and since it's not yet possible to change rule parameters from SonarLint in standalone mode, it is a major annoyance.
I've created a ticket to fix this: SONARJAVA-2596

Thanks for your feedback,

selman...@gmail.com

unread,
Feb 21, 2018, 7:21:26 AM2/21/18
to SonarLint
Hi,I see this issue is already fixed.

Is there a roadmap to incorporate this fix with SonarLint IntellijIdea Plugin?

Thanks
Reply all
Reply to author
Forward
0 new messages