Skip to content

Commit

Permalink
Merge pull request #46 from uber/more-linting
Browse files Browse the repository at this point in the history
Lint more things
  • Loading branch information
ascandella committed Jul 9, 2015
2 parents 28d4de8 + ffbd2f2 commit fe3e93b
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 17 deletions.
36 changes: 32 additions & 4 deletions config/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,40 @@
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">

<module name="Checker">
<property name="charset" value="UTF-8"/>

<!-- Trailing spaces -->
<module name="RegexpSingleline">
<property name="format" value="\s+$"/>
<property name="message" value="Line has trailing spaces."/>
</module>

<!-- Double blank lines -->
<module name="RegexpMultiline">
<property name="format" value="\n\n\n"/>
<property name="message" value="Double blank lines."/>
</module>
<module name="NewlineAtEndOfFile"/>
<module name="FileTabCharacter">
<property name="eachLine" value="true"/>
</module>

<module name="TreeWalker">
<module name="ParameterName"/>
<module name="LocalFinalVariableName"/>
<module name="LocalVariableName"/>
<module name="MethodName"/>

<!-- Order -->
<module name="InnerTypeLast"/>
<module name="DeclarationOrder"/>
<module name="ModifierOrder"/>
<module name="RedundantModifier"/>

<module name="OneTopLevelClass"/>
<module name="NoLineWrap"/>
<module name="EmptyBlock"/>
<module name="Indentation"/>
<module name="MethodName"/>
<module name="EmptyLineSeparator">
<property name="allowNoEmptyLineBetweenFields" value="true"/>
</module>
Expand All @@ -34,11 +56,17 @@
<property name="allowEmptyTypes" value="true"/>
<property name="allowEmptyLoops" value="true"/>
</module>
<module name="OneStatementPerLine"/>
<module name="MultipleVariableDeclarations"/>
<module name="ArrayTypeStyle"/>

<module name="MissingSwitchDefault"/>
<module name="FallThrough"/>
<module name="GenericWhitespace"/>

<!-- Style -->
<module name="UpperEll"/>
<module name="ArrayTypeStyle"/>
<module name="MultipleVariableDeclarations"/>
<module name="OneStatementPerLine"/>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
</module>
</module>
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import org.kohsuke.stapler.StaplerRequest;

@SuppressWarnings("UnusedDeclaration")
@Extension // This indicates to Jenkins that this is an implementation of an extension point.
@Extension
public final class PhabricatorBuildWrapperDescriptor extends BuildWrapperDescriptor {
private String conduitURL;
private String conduitToken;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
import static java.lang.Integer.parseInt;

public class PhabricatorNotifier extends Notifier {

private static final int DEFAULT_COMMENT_SIZE = 1000;
// Post a comment on success. Useful for lengthy builds.
private final boolean commentOnSuccess;
private final boolean uberallsEnabled;
Expand Down Expand Up @@ -284,7 +284,6 @@ private String getRemoteComment(AbstractBuild<?, ?> build, PrintStream logger, S

FilePath source = src[0];

int DEFAULT_COMMENT_SIZE = 1000;
int maxLength = DEFAULT_COMMENT_SIZE;
if (!CommonUtils.isBlank(maxSize)) {
maxLength = parseInt(maxSize, 10);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,17 @@
* for the actual HTML fragment for the configuration screen.
*/
@SuppressWarnings("UnusedDeclaration")
@Extension // This indicates to Jenkins that this is an implementation of an extension point.
@Extension
public final class PhabricatorNotifierDescriptor extends BuildStepDescriptor<Publisher> {
private String conduitURL;
private String uberallsURL;
private String commentFile;
private String commentSize;

public PhabricatorNotifierDescriptor() {
super(PhabricatorNotifier.class);
load();
}

public String getCommentSize() {
return commentSize;
Expand All @@ -50,13 +56,6 @@ public void setCommentSize(String commentSize) {
this.commentSize = commentSize;
}

private String commentSize;

public PhabricatorNotifierDescriptor() {
super(PhabricatorNotifier.class);
load();
}

public boolean isApplicable(Class<? extends AbstractProject> aClass) {
// Indicates that this builder can be used with all kinds of project types
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@
import java.io.File;

public class PhabricatorPlugin extends Plugin {
public static final String CONDUIT_TOKEN = "CONDUIT_TOKEN";
public static final String ARCANIST_PATH = "ARCANIST_PATH";

// Diff ID (not differential ID)
static final String DIFFERENTIAL_ID_FIELD = "DIFF_ID";
// Phabricator object ID (for Harbormaster)
static final String PHID_FIELD = "PHID";

static final String WRAP_KEY = "PHABRICATOR_JENKINS";
public static final String CONDUIT_TOKEN = "CONDUIT_TOKEN";
public static final String ARCANIST_PATH = "ARCANIST_PATH";

public static String getIconPath(String icon) {
if (icon == null) {
Expand Down

0 comments on commit fe3e93b

Please sign in to comment.