diff --git a/ChangeLog b/ChangeLog index c4eeacdcb..b0e723883 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2001-07-02 Oliver Burn + * docs/index.html: Added that can ignore checking braces. + + * docs/cmdline.html: Added docs for IgnoreBraces property. + + * docs/anttask.html: Added docs for IgnoreBraces property. + + * src/checkstyle/com/puppycrawl/tools/checkstyle/CheckStyleTask.java: + Added support for the IgnoreBraces property. + * src/checkstyle/com/puppycrawl/tools/checkstyle/VerifierImpl.java: Added support for the IgnoreBraces property. diff --git a/build.xml b/build.xml index 0ac1e4a4c..5cb40798a 100644 --- a/build.xml +++ b/build.xml @@ -107,7 +107,9 @@ classname="com.puppycrawl.tools.checkstyle.CheckStyleTask"> - + diff --git a/docs/anttask.html b/docs/anttask.html index 363956d5f..7f66f9d46 100644 --- a/docs/anttask.html +++ b/docs/anttask.html @@ -44,17 +44,17 @@ This task is included in the checkstyle distribution.

allowtabs - Indicates whether to allow tabs. Defaults to "no". + Indicates whether to allow tabs. Defaults to "false". No allowprotected - Indicates whether to allow protected data. Defaults to "no". + Indicates whether to allow protected data. Defaults to "false". No allownoauthor - Indicates whether to allow no @author tag to be defined for class and interface Javadoc comments. Defaults to "no". + Indicates whether to allow no @author tag to be defined for class and interface Javadoc comments. Defaults to "false". No @@ -99,17 +99,22 @@ This task is included in the checkstyle distribution.

relaxjavadoc - Specifies whether to relax checking Javadoc comments. Defaults to "no". + Specifies whether to relax checking Javadoc comments. Defaults to "false". No ignoreimports - Specifies whether to ignore checking import statements. Defaults to "no". + Specifies whether to ignore checking import statements. Defaults to "false". No ignorewhitespace - Specifies whether to ignore checking whitespace. Defaults to "no". + Specifies whether to ignore checking whitespace. Defaults to "false". + No + + + ignorebraces + Specifies whether to ignore checking braces. Defaults to "false". No diff --git a/docs/cmdline.html b/docs/cmdline.html index 8a3ee4898..930219f31 100644 --- a/docs/cmdline.html +++ b/docs/cmdline.html @@ -95,6 +95,10 @@ This command line tool is included in the checkstyle distribution.

checkstyle.ignore.whitespace Specifies whether to ignore checking whitespace. Defaults to "no". + + checkstyle.ignore.braces + Specifies whether to ignore checking braces. Defaults to "no". +

Examples

diff --git a/docs/index.html b/docs/index.html index 53fb727b4..8d4ead5f9 100644 --- a/docs/index.html +++ b/docs/index.html @@ -36,7 +36,7 @@ div.tip {margin-left : 5%;margin-right : 5%;padding-left: 2%; padding-right: 2%;
  • Format of parameter names match a specified regular expression.
  • Variables that are not declared as private or protected.
  • Correct use of white space around binary and unary operators. For example, x -=- 1; is illegal, whereas x -= -1; is not. Note: these checks can be turned off.
  • -
  • Ensure {}'s are used for if/while/for/do constructs.
  • +
  • Ensure {}'s are used for if/while/for/do constructs. Note: this check can be turned off.
  • Lines are not longer than a specified length.
  • Lines do not contain tabs. Note: this check can be turned off.
  • @@ -203,6 +203,9 @@ div.tip {margin-left : 5%;margin-right : 5%;padding-left: 2%; padding-right: 2%;
  • do/while
  • +

    This feature can be turned off.

    + +

    File Header

    Ensure that the file starts with a specified header. The header contents are specified in a file. If no file is specified, checkstyle does not check for a header.

    diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/CheckStyleTask.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/CheckStyleTask.java index da4d1a004..c35242db3 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/CheckStyleTask.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/CheckStyleTask.java @@ -64,31 +64,31 @@ public class CheckStyleTask } /** @param aAllowed whether tabs are allowed **/ - public void setAllowtabs(boolean aAllowed) + public void setAllowTabs(boolean aAllowed) { mConfig.setAllowTabs(aAllowed); } /** @param aAllowed whether protected data is allowed **/ - public void setAllowprotected(boolean aAllowed) + public void setAllowProtected(boolean aAllowed) { mConfig.setAllowProtected(aAllowed); } /** @param aAllowed whether allow having no author **/ - public void setAllownoauthor(boolean aAllowed) + public void setAllowNoAuthor(boolean aAllowed) { mConfig.setAllowNoAuthor(aAllowed); } /** @param aLen max allowed line length **/ - public void setMaxlinelen(int aLen) + public void setMaxLineLen(int aLen) { mConfig.setMaxLineLength(aLen); } /** @param aPat pattern for member variables **/ - public void setMemberpattern(String aPat) + public void setMemberPattern(String aPat) { try { mConfig.setMemberPat(aPat); @@ -100,7 +100,7 @@ public class CheckStyleTask } /** @param aPat pattern for parameters **/ - public void setParampattern(String aPat) + public void setParamPattern(String aPat) { try { mConfig.setParamPat(aPat); @@ -112,7 +112,7 @@ public class CheckStyleTask } /** @param aPat pattern for constant variables **/ - public void setConstpattern(String aPat) + public void setConstPattern(String aPat) { try { mConfig.setStaticFinalPat(aPat); @@ -124,7 +124,7 @@ public class CheckStyleTask } /** @param aPat pattern for static variables **/ - public void setStaticpattern(String aPat) + public void setStaticPattern(String aPat) { try { mConfig.setStaticPat(aPat); @@ -136,7 +136,7 @@ public class CheckStyleTask } /** @param aPat pattern for type names **/ - public void setTypepattern(String aPat) + public void setTypePattern(String aPat) { try { mConfig.setTypePat(aPat); @@ -148,7 +148,7 @@ public class CheckStyleTask } /** @param aName header file name **/ - public void setHeaderfile(File aName) + public void setHeaderFile(File aName) { try { mConfig.setHeaderFile(aName.getAbsolutePath()); @@ -160,7 +160,7 @@ public class CheckStyleTask } /** @param aNum **/ - public void setHeaderignoreline(int aNum) + public void setHeaderIgnoreLine(int aNum) { mConfig.setHeaderIgnoreLineNo(aNum); } @@ -183,6 +183,12 @@ public class CheckStyleTask mConfig.setIgnoreWhitespace(aIgnore); } + /** @param aIgnore whether to ignore braces **/ + public void setIgnoreBraces(boolean aIgnore) + { + mConfig.setIgnoreBraces(aIgnore); + } + //////////////////////////////////////////////////////////////////////////// // The doers ////////////////////////////////////////////////////////////////////////////