Skip to content
Permalink
Browse files

Merge pull request #8 from jenkinsci/messages

Decoupling class and text so we can now support i18
  • Loading branch information...
v1v committed Feb 23, 2017
2 parents 736f3f7 + ac58ae5 commit 15469404b4f477e9920d9b9cafee0115ef30aefe
Showing with 191 additions and 73 deletions.
  1. +2 −4 src/main/java/org/jenkins/ci/plugins/jenkinslint/check/ArtifactChecker.java
  2. +2 −4 src/main/java/org/jenkins/ci/plugins/jenkinslint/check/CleanupWorkspaceChecker.java
  3. +2 −3 src/main/java/org/jenkins/ci/plugins/jenkinslint/check/GitRefChecker.java
  4. +2 −3 src/main/java/org/jenkins/ci/plugins/jenkinslint/check/GitShallowChecker.java
  5. +2 −5 src/main/java/org/jenkins/ci/plugins/jenkinslint/check/GradleWrapperChecker.java
  6. +2 −4 src/main/java/org/jenkins/ci/plugins/jenkinslint/check/GroovySystemExitChecker.java
  7. +3 −4 src/main/java/org/jenkins/ci/plugins/jenkinslint/check/HardcodedScriptChecker.java
  8. +2 −4 src/main/java/org/jenkins/ci/plugins/jenkinslint/check/JavadocChecker.java
  9. +2 −2 src/main/java/org/jenkins/ci/plugins/jenkinslint/check/JobAssignedLabelChecker.java
  10. +2 −2 src/main/java/org/jenkins/ci/plugins/jenkinslint/check/JobDescriptionChecker.java
  11. +2 −3 src/main/java/org/jenkins/ci/plugins/jenkinslint/check/JobLogRotatorChecker.java
  12. +2 −3 src/main/java/org/jenkins/ci/plugins/jenkinslint/check/JobNameChecker.java
  13. +2 −3 src/main/java/org/jenkins/ci/plugins/jenkinslint/check/MasterLabelChecker.java
  14. +2 −5 src/main/java/org/jenkins/ci/plugins/jenkinslint/check/MavenJobTypeChecker.java
  15. +2 −4 src/main/java/org/jenkins/ci/plugins/jenkinslint/check/MultibranchJobTypeChecker.java
  16. +2 −3 src/main/java/org/jenkins/ci/plugins/jenkinslint/check/NullSCMChecker.java
  17. +2 −4 src/main/java/org/jenkins/ci/plugins/jenkinslint/check/PollingSCMTriggerChecker.java
  18. +2 −2 src/main/java/org/jenkins/ci/plugins/jenkinslint/check/SlaveDescriptionChecker.java
  19. +2 −2 src/main/java/org/jenkins/ci/plugins/jenkinslint/check/SlaveLabelChecker.java
  20. +2 −2 src/main/java/org/jenkins/ci/plugins/jenkinslint/check/SlaveVersionChecker.java
  21. +2 −3 src/main/java/org/jenkins/ci/plugins/jenkinslint/check/TimeoutChecker.java
  22. +2 −4 src/main/java/org/jenkins/ci/plugins/jenkinslint/check/WindowsSlaveLaunchChecker.java
  23. +146 −0 src/main/resources/org/jenkins/ci/plugins/jenkinslint/check/Messages.properties
@@ -17,10 +17,8 @@

public ArtifactChecker() {
super();
this.setDescription("When setting Jenkins Jobs with Archive Artifact post build you should either set which "+
"artifacts or remove this unused publisher phase.<br/>" +
"Otherwise the archive artifact phase may not match what you expect.");
this.setSeverity("Low");
this.setDescription(Messages.ArtifactCheckerDesc());
this.setSeverity(Messages.ArtifactCheckerSeverity());
}

public boolean executeCheck(Item item) {
@@ -13,10 +13,8 @@

public CleanupWorkspaceChecker() {
super();
this.setDescription("There are some builds which demand a lot of disc space. Some builds might run " +
"out of space during the build itself and cause build errors.<br/>" +
"It's recommended to wipe out those workspaces after building.");
this.setSeverity("Medium");
this.setDescription(Messages.CleanupWorkspaceCheckerDesc());
this.setSeverity(Messages.CleanupWorkspaceCheckerSeverity());
}

public boolean executeCheck(Item item) {
@@ -17,9 +17,8 @@

public GitRefChecker() {
super();
this.setDescription("When setting Jenkins Jobs with Git SCM you might speed up the cloning time if " +
"you use git ref repos when cloning.");
this.setSeverity("Low");
this.setDescription(Messages.GitRefCheckerDesc());
this.setSeverity(Messages.GitRefCheckerSeverity());
}

public boolean executeCheck(Item item) {
@@ -16,9 +16,8 @@

public GitShallowChecker() {
super();
this.setDescription("When setting Jenkins Jobs with Git SCM Artifact you might speed up the cloning time if " +
"you use shallow cloning.");
this.setSeverity("Medium");
this.setDescription(Messages.GitShallowCheckerDesc());
this.setSeverity(Messages.GitShallowCheckerSeverity());
}

public boolean executeCheck(Item item) {
@@ -18,11 +18,8 @@

public GradleWrapperChecker() {
super();
this.setDescription("By distributing the wrapper with your project, anyone can work with it without needing to " +
"install Gradle beforehand. Even better, users of the build <br/> are guaranteed to use the " +
"version of Gradle that the build was designed to work with. Further details: " +
"<a href=https://docs.gradle.org/current/userguide/gradle_wrapper.html> Gradle Wrapper docs</a>.");
this.setSeverity("Medium");
this.setDescription(Messages.GradleWrapperCheckerDesc());
this.setSeverity(Messages.GradleWrapperCheckerSeverity());
}

public boolean executeCheck(Item item) {
@@ -18,10 +18,8 @@

public GroovySystemExitChecker() {
super();
this.setDescription("System groovy scripts run in same JVM as Jenkins master, so there's no surprise that System.exit() kills your Jenkins master. " +
"<br/> Throwing an exception is definitely better approach how to announce some problem in the script. Further details: " +
"<a href=https://issues.jenkins-ci.org/browse/JENKINS-14023>JENKINS-14023</a>.");
this.setSeverity("High");
this.setDescription(Messages.GroovySystemExitCheckerDesc());
this.setSeverity(Messages.GroovySystemExitCheckerSeverity());
}

public boolean executeCheck(Item item) {
@@ -21,10 +21,9 @@

public HardcodedScriptChecker() {
super();
this.setDescription("When setting Jenkins Jobs with Shell/Batch builds you shouldn't hardcoded the script "+
"it's recommended to track them in your SCM tool instead.<br/>" +
"Otherwise you won't be able to reproduce your CI environment easily.");
this.setSeverity("Medium");

this.setDescription(Messages.HardcodedScriptCheckerDesc());
this.setSeverity(Messages.HardcodedScriptCheckerSeverity());
}

public boolean executeCheck(Item item) {
@@ -15,10 +15,8 @@

public JavadocChecker() {
super();
this.setDescription("When setting Jenkins Jobs with Javadoc post build you should either set which javadocs " +
"or remove this unused publisher phase.<br/>" +
"Otherwise the archive artifact phase may not match what you expect.");
this.setSeverity("Low");
this.setDescription(Messages.JavadocCheckerDesc());
this.setSeverity(Messages.JavadocCheckerSeverity());
}

public boolean executeCheck(Item item) {
@@ -11,8 +11,8 @@

public JobAssignedLabelChecker() {
super();
this.setDescription("When setting Jenkins Jobs you should set where those Jobs can run.");
this.setSeverity("Medium");
this.setDescription(Messages.JobAssignedLabelCheckerDesc());
this.setSeverity(Messages.JobAssignedLabelCheckerSeverity());
}

public boolean executeCheck(Item item) {
@@ -11,8 +11,8 @@

public JobDescriptionChecker() {
super();
this.setDescription("Jenkins project description might help you to know what it does and further details.");
this.setSeverity("Medium");
this.setDescription(Messages.JobDescriptionCheckerDesc());
this.setSeverity(Messages.JobDescriptionCheckerSeverity());
}

public boolean executeCheck(Item item) {
@@ -15,9 +15,8 @@

public JobLogRotatorChecker() {
super();
this.setDescription("When setting Jenkins Jobs with some Log Rotator configuration helps to reduce the <br/> "+
"amount of disk space and speed up Jenkins UI.");
this.setSeverity("High");
this.setDescription(Messages.JobLogRotatorCheckerDesc());
this.setSeverity(Messages.JobLogRotatorCheckerSeverity());
}

public boolean executeCheck(Item item) {
@@ -10,9 +10,8 @@

public JobNameChecker() {
super();
this.setDescription("When creating Jenkins Jobs you must avoid whitespace. In order to comply with the style " +
"guide");
this.setSeverity("High");
this.setDescription(Messages.JobNameCheckerDesc());
this.setSeverity(Messages.JobNameCheckerSeverity());
}

public boolean executeCheck(Item item) {
@@ -11,9 +11,8 @@

public MasterLabelChecker() {
super();
this.setDescription("When setting Jenkins Jobs you should set where those Jobs can run. and " +
"avoid master label.<br/>Jenkins master shouldn't consume any CPU for building jobs.");
this.setSeverity("Medium");
this.setDescription(Messages.MasterLabelCheckerDesc());
this.setSeverity(Messages.MasterLabelCheckerSeverity());
}

public boolean executeCheck(Item item) {
@@ -10,11 +10,8 @@

public MavenJobTypeChecker() {
super();
this.setDescription("Maven job type builds considerably slowly compared to the freestyle projects.<br/>Besides " +
"of that it has its own set of bugs. t's worth to use freeStyle jobs and specify the maven " +
"build wrapper instead.<br/>" +
"<a href=https://issues.jenkins-ci.org/browse/JENKINS-22354>Open ticket</a>.");
this.setSeverity("High");
this.setDescription(Messages.MavenJobTypeCheckerDesc());
this.setSeverity(Messages.MavenJobTypeCheckerSeverity());
}

public boolean executeCheck(Item item) {
@@ -10,10 +10,8 @@

public MultibranchJobTypeChecker() {
super();
this.setDescription("Polling in Jenkins is inefficient, MultibranchJobProject polls for new branches and also " +
"every branch polls for new changes.<br/>It's strongly recommended to use another approach, " +
"such as: webhooks, Configuration as Code, ...");
this.setSeverity("High");
this.setDescription(Messages.MultibranchJobTypeCheckerDesc());
this.setSeverity(Messages.MultibranchJobTypeCheckerSeverity());
}

public boolean executeCheck(Item item) {
@@ -11,9 +11,8 @@

public NullSCMChecker() {
super();
this.setDescription("Jenkins works fine with cron/batch tasks, It's strongly recommended to use any " +
"SCM tool and therefore to have in that repo whatever script you need to run.");
this.setSeverity("Low");
this.setDescription(Messages.NullSCMCheckerDesc());
this.setSeverity(Messages.NullSCMCheckerSeverity());
}

public boolean executeCheck(Item item) {
@@ -12,10 +12,8 @@

public PollingSCMTriggerChecker() {
super();
this.setDescription("Polling a repository from Jenkins is inefficient; it adds delay on the order of minutes " +
"before a build starts after a commit is pushed, and it adds additional loads.<br/>" +
"It is much better instead to do push-notification from the repository.");
this.setSeverity("High");
this.setDescription(Messages.PollingSCMTriggerCheckerDesc());
this.setSeverity(Messages.PollingSCMTriggerCheckerSeverity());
}

public boolean executeCheck(Item item) {
@@ -10,8 +10,8 @@

public SlaveDescriptionChecker() {
super();
this.setDescription("Jenkins slave description might help you to know what it does and further details.");
this.setSeverity("Medium");
this.setDescription(Messages.SlaveDescriptionCheckerDesc());
this.setSeverity(Messages.SlaveDescriptionCheckerSeverity());
}

public boolean executeCheck(Node item) {
@@ -12,8 +12,8 @@

public SlaveLabelChecker() {
super();
this.setDescription("When setting Jenkins Slaves you should set their labels in order to tie those Jobs.");
this.setSeverity("Medium");
this.setDescription(Messages.SlaveLabelCheckerDesc());
this.setSeverity(Messages.SlaveLabelCheckerSeverity());
}

public boolean executeCheck(Node item) {
@@ -17,8 +17,8 @@

public SlaveVersionChecker() {
super();
this.setDescription("Jenkins slave description might help you to know what it does and further details.");
this.setSeverity("Medium");
this.setDescription(Messages.SlaveVersionCheckerDesc());
this.setSeverity(Messages.SlaveVersionCheckerSeverity());
}

public boolean executeCheck(Node item) {
@@ -20,9 +20,8 @@

public TimeoutChecker() {
super();
this.setDescription("There are some builds which might hang forever and cause inaction in the build queue and slaves. " +
"It's recommended to control those time based on the <a href=https://wiki.jenkins-ci.org/display/JENKINS/Build-timeout+Plugin>build timeout plugin</a>.");
this.setSeverity("Medium");
this.setDescription(Messages.TimeoutCheckerDesc());
this.setSeverity(Messages.TimeoutCheckerSeverity());
}

public boolean executeCheck(Item item) {
@@ -13,10 +13,8 @@

public WindowsSlaveLaunchChecker() {
super();
this.setDescription("This launch method relies on DCOM and is often associated with <a href=https://wiki.jenkins-ci.org/display/JENKINS/Windows+slaves+fail+to+start+via+DCOM>subtle problems</a>. " +
"Consider using Launch slave agents using Java Web Start instead,<br/>which also permits " +
"installation as a Windows service but is generally considered more reliable.");
this.setSeverity("Medium");
this.setDescription(Messages.WindowsSlaveLaunchCheckerDesc());
this.setSeverity(Messages.WindowsSlaveLaunchCheckerSeverity());
}

public boolean executeCheck(Node item) {

0 comments on commit 1546940

Please sign in to comment.
You can’t perform that action at this time.