removed line/method length stuff from old codebase
This commit is contained in:
parent
ceff53c8a4
commit
9cd5e92d94
|
|
@ -87,8 +87,6 @@ public class Configuration
|
|||
/** map of int properties **/
|
||||
private final Map mIntProps = new HashMap();
|
||||
{
|
||||
mIntProps.put(Defn.MAX_LINE_LENGTH_PROP, new Integer(80));
|
||||
mIntProps.put(Defn.MAX_METHOD_LENGTH_PROP, new Integer(150));
|
||||
mIntProps.put(Defn.MAX_CONSTRUCTOR_LENGTH_PROP, new Integer(150));
|
||||
mIntProps.put(Defn.TAB_WIDTH_PROP, new Integer(8));
|
||||
}
|
||||
|
|
@ -377,18 +375,6 @@ public class Configuration
|
|||
return getRegexpProperty(Defn.LOCAL_FINAL_VAR_PATTERN_PROP);
|
||||
}
|
||||
|
||||
/** @return the maximum line length **/
|
||||
int getMaxLineLength()
|
||||
{
|
||||
return getIntProperty(Defn.MAX_LINE_LENGTH_PROP);
|
||||
}
|
||||
|
||||
/** @return the maximum method length **/
|
||||
int getMaxMethodLength()
|
||||
{
|
||||
return getIntProperty(Defn.MAX_METHOD_LENGTH_PROP);
|
||||
}
|
||||
|
||||
/** @return the maximum constructor length **/
|
||||
int getMaxConstructorLength()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -43,10 +43,6 @@ public interface Defn
|
|||
String LOCAL_VAR_PATTERN_PROP = "checkstyle.pattern.localvar";
|
||||
/** property name for the method local final variable pattern **/
|
||||
String LOCAL_FINAL_VAR_PATTERN_PROP = "checkstyle.pattern.localfinalvar";
|
||||
/** property name for the maximum line length **/
|
||||
String MAX_LINE_LENGTH_PROP = "checkstyle.maxlinelen";
|
||||
/** property name for length of methods **/
|
||||
String MAX_METHOD_LENGTH_PROP = "checkstyle.maxmethodlen";
|
||||
/** property name for length of constructors **/
|
||||
String MAX_CONSTRUCTOR_LENGTH_PROP = "checkstyle.maxconstructorlen";
|
||||
/** property name for allowing protected data **/
|
||||
|
|
@ -121,8 +117,6 @@ public interface Defn
|
|||
String[] ALL_INT_PROPS = new String[]
|
||||
{
|
||||
MAX_CONSTRUCTOR_LENGTH_PROP,
|
||||
MAX_LINE_LENGTH_PROP,
|
||||
MAX_METHOD_LENGTH_PROP,
|
||||
TAB_WIDTH_PROP,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -531,11 +531,6 @@ class Verifier
|
|||
*/
|
||||
void verifyMethodLength(int aLineNo, int aLength)
|
||||
{
|
||||
if (aLength > mConfig.getMaxMethodLength()) {
|
||||
mMessages.add(aLineNo, "maxLen.method",
|
||||
new Integer(aLength),
|
||||
new Integer(mConfig.getMaxMethodLength()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -330,7 +330,6 @@ public class CheckerTest
|
|||
public void testSimple()
|
||||
throws Exception
|
||||
{
|
||||
mProps.setProperty(Defn.MAX_METHOD_LENGTH_PROP, "19");
|
||||
mProps.setProperty(Defn.MAX_CONSTRUCTOR_LENGTH_PROP, "9");
|
||||
mProps.setProperty(Defn.STATIC_PATTERN_PROP, "^s[A-Z][a-zA-Z0-9]*$");
|
||||
mProps.setProperty(Defn.MEMBER_PATTERN_PROP, "^m[A-Z][a-zA-Z0-9]*$");
|
||||
|
|
@ -346,7 +345,6 @@ public class CheckerTest
|
|||
filepath + ":35:17: Name 'badMember' must match pattern '^m[A-Z][a-zA-Z0-9]*$'.",
|
||||
filepath + ":42:40: ',' is not followed by whitespace.",
|
||||
filepath + ":71:30: ',' is not followed by whitespace.",
|
||||
filepath + ":80: Method length is 20 lines (max allowed is 19).",
|
||||
filepath + ":103: Constructor length is 10 lines (max allowed is 9).",
|
||||
filepath + ":119:13: Name 'ABC' must match pattern '^[a-z][a-zA-Z0-9]*$'.",
|
||||
filepath + ":122:19: Name 'cde' must match pattern '[A-Z]+'.",
|
||||
|
|
|
|||
|
|
@ -15,11 +15,9 @@ public class ConfigurationTest
|
|||
public void test1() throws Exception
|
||||
{
|
||||
final Properties p = new Properties();
|
||||
p.setProperty(Defn.MAX_LINE_LENGTH_PROP, "66");
|
||||
p.setProperty(Defn.CATCH_BLOCK_PROP, "text");
|
||||
final Configuration c = new Configuration(p, System.out);
|
||||
assertNotNull(c);
|
||||
assertEquals(66, c.getMaxLineLength());
|
||||
assertEquals(BlockOption.TEXT, c.getCatchBlock());
|
||||
}
|
||||
|
||||
|
|
@ -34,12 +32,9 @@ public class ConfigurationTest
|
|||
public void testGetProperties() throws Exception
|
||||
{
|
||||
final Properties props = new Properties();
|
||||
props.setProperty(Defn.MAX_LINE_LENGTH_PROP, "666");
|
||||
props.setProperty(Defn.MEMBER_PATTERN_PROP, "bulldogs");
|
||||
|
||||
final Configuration c = new Configuration(props, System.out);
|
||||
assertEquals("666",
|
||||
c.getProperties().getProperty(Defn.MAX_LINE_LENGTH_PROP));
|
||||
assertEquals("bulldogs",
|
||||
c.getProperties().getProperty(Defn.MEMBER_PATTERN_PROP));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue