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

AbbreviationAsWordInName: problem detection of 2 char abbreviation with length limit 1 #116

Closed
romani opened this Issue Jun 16, 2013 · 3 comments

Comments

Projects
None yet
3 participants
@romani
Member

romani commented Jun 16, 2013

Config:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="Checker">
  <property name="severity" value="warning"/>
  <module name="TreeWalker">
    <module name="AbbreviationAsWordInName">
      <property name="allowedAbbreviationLength" value="1"/>
      <property name="targets" value="CLASS_DEF,INTERFACE_DEF,ENUM_DEF,ANNOTATION_DEF,ANNOTATION_FIELD_DEF,ENUM_CONSTANT_DEF,PARAMETER_DEF,VARIABLE_DEF,METHOD_DEF"/>
    </module>
  </module>
</module>

Code:

public class FIleNameFormatException extends Exception {

    private static final long serialVersionUID = 1L;

    public FIleNameFormatException(Exception e) {
        super(e);
    }
}

Detected: no warning on class name.

Expected: warring on class name. Please create UT for this.

@ghost ghost assigned kostas1981 Jul 15, 2013

@ghost ghost assigned baratali Aug 2, 2013

@romani

This comment has been minimized.

Show comment
Hide comment
@romani

romani Aug 12, 2013

Member

Reported problem is valid case, to cover this we need to make allowedAbbreviationLength=0.
extend ignore list to have "IT" and "I" to suppress most false-positives.
but in this case we have problem on following cases, when capital letter is a last. Message is "Abbreviation As Word In Name: Abbreviation in name must contain no more than '0' capital letters."

            double scaleX = getWidth() / (double) backgroundImage.getWidth(null);
            double scaleY = getHeight() / (double) backgroundImage.getHeight(null);

so please fix this problem.

Member

romani commented Aug 12, 2013

Reported problem is valid case, to cover this we need to make allowedAbbreviationLength=0.
extend ignore list to have "IT" and "I" to suppress most false-positives.
but in this case we have problem on following cases, when capital letter is a last. Message is "Abbreviation As Word In Name: Abbreviation in name must contain no more than '0' capital letters."

            double scaleX = getWidth() / (double) backgroundImage.getWidth(null);
            double scaleY = getHeight() / (double) backgroundImage.getHeight(null);

so please fix this problem.

@baratali

This comment has been minimized.

Show comment
Hide comment
@baratali

baratali Aug 15, 2013

Contributor

So, it shouldn't display warning on scaleX and should display warning on FIleNameFormatException when allowedAbbreviationLength=0. Right?

Contributor

baratali commented Aug 15, 2013

So, it shouldn't display warning on scaleX and should display warning on FIleNameFormatException when allowedAbbreviationLength=0. Right?

@romani

This comment has been minimized.

Show comment
Hide comment
@romani

romani Aug 24, 2013

Member

right.

Member

romani commented Aug 24, 2013

right.

baratali added a commit to baratali/sevntu.checkstyle that referenced this issue Sep 7, 2013

baratali added a commit to baratali/sevntu.checkstyle that referenced this issue Sep 7, 2013

@romani romani closed this in e64d40c Sep 7, 2013

romani added a commit that referenced this issue Sep 7, 2013

Merge pull request #132 from baratali/iss116
Fixes #116. Update for AbbreviationAsWordInNameCheck.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment