Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-46146

"Hardcoded Script Checker - Threshold": Don't count comment lines

    Details

    • Type: Improvement
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: jenkinslint-plugin
    • Labels:
    • Environment:
      Jenkins 2.71 running using JDK1.8_141 on RH6 Linux, no container
      jenkinslint 0.10.1
    • Similar Issues:

      Description

      It seems the

        Hardcoded Script Checker - Threshold

      counts at least comment lines (and probably also empty lines or lines just containing whitespace)

      It would be nice, to not count these. We sometimes have comment blocks before one or two lines of script calling. This now forces us, to set a rather big threshold.

      And as an extra a help entry on the configuration page would be nice for this entry.

        Attachments

          Activity

          Hide
          v2v Victor Martinez added a comment -

          What if adding a global settings checkbox to enable/disable whether to count the comment lines or not? Same as enabling/disabling checkers globally or configuring the threshold of number of lines

          Cheers

          Show
          v2v Victor Martinez added a comment - What if adding a global settings checkbox to enable/disable whether to count the comment lines or not? Same as enabling/disabling checkers globally or configuring the threshold of number of lines Cheers
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Victor Martinez
          Path:
          src/main/java/org/jenkins/ci/plugins/jenkinslint/JenkinsLintGlobalConfiguration.java
          src/main/java/org/jenkins/ci/plugins/jenkinslint/check/HardcodedScriptChecker.java
          src/main/java/org/jenkins/ci/plugins/jenkinslint/check/TimerTriggerChecker.java
          src/main/java/org/jenkins/ci/plugins/jenkinslint/model/AbstractAction.java
          src/main/java/org/jenkins/ci/plugins/jenkinslint/utils/StringUtils.java
          src/main/resources/org/jenkins/ci/plugins/jenkinslint/JenkinsLintGlobalConfiguration/config.jelly
          src/test/java/org/jenkins/ci/plugins/jenkinslint/check/HardcodedScriptCheckerTestCase.java
          src/test/java/org/jenkins/ci/plugins/jenkinslint/utils/StringUtilsTestCase.java
          http://jenkins-ci.org/commit/jenkinslint-plugin/d70dc55acb95d51232815158b980371b5b11d801
          Log:
          JENKINS-46146 Ignore commented lines in the HardcodedScript Checker, it's a global settings to be enabled/disabled globally

          Change-Id: I1ef684fc8007883fc1ccf8fa3f74ba63f5bb204b

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Victor Martinez Path: src/main/java/org/jenkins/ci/plugins/jenkinslint/JenkinsLintGlobalConfiguration.java src/main/java/org/jenkins/ci/plugins/jenkinslint/check/HardcodedScriptChecker.java src/main/java/org/jenkins/ci/plugins/jenkinslint/check/TimerTriggerChecker.java src/main/java/org/jenkins/ci/plugins/jenkinslint/model/AbstractAction.java src/main/java/org/jenkins/ci/plugins/jenkinslint/utils/StringUtils.java src/main/resources/org/jenkins/ci/plugins/jenkinslint/JenkinsLintGlobalConfiguration/config.jelly src/test/java/org/jenkins/ci/plugins/jenkinslint/check/HardcodedScriptCheckerTestCase.java src/test/java/org/jenkins/ci/plugins/jenkinslint/utils/StringUtilsTestCase.java http://jenkins-ci.org/commit/jenkinslint-plugin/d70dc55acb95d51232815158b980371b5b11d801 Log: JENKINS-46146 Ignore commented lines in the HardcodedScript Checker, it's a global settings to be enabled/disabled globally Change-Id: I1ef684fc8007883fc1ccf8fa3f74ba63f5bb204b
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Victor Martinez
          Path:
          src/main/java/org/jenkins/ci/plugins/jenkinslint/JenkinsLintGlobalConfiguration.java
          src/main/java/org/jenkins/ci/plugins/jenkinslint/check/HardcodedScriptChecker.java
          src/main/java/org/jenkins/ci/plugins/jenkinslint/check/TimerTriggerChecker.java
          src/main/java/org/jenkins/ci/plugins/jenkinslint/model/AbstractAction.java
          src/main/java/org/jenkins/ci/plugins/jenkinslint/utils/StringUtils.java
          src/main/resources/org/jenkins/ci/plugins/jenkinslint/JenkinsLintGlobalConfiguration/config.jelly
          src/test/java/org/jenkins/ci/plugins/jenkinslint/check/HardcodedScriptCheckerTestCase.java
          src/test/java/org/jenkins/ci/plugins/jenkinslint/utils/StringUtilsTestCase.java
          http://jenkins-ci.org/commit/jenkinslint-plugin/7eaac06013567e6102618c3040b03a2dcbac548d
          Log:
          JENKINS-46146 Ignore commented lines in the HardcodedScript Checker, it's a global settings to be enabled/disabled globally (#29)

          Change-Id: I1ef684fc8007883fc1ccf8fa3f74ba63f5bb204b

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Victor Martinez Path: src/main/java/org/jenkins/ci/plugins/jenkinslint/JenkinsLintGlobalConfiguration.java src/main/java/org/jenkins/ci/plugins/jenkinslint/check/HardcodedScriptChecker.java src/main/java/org/jenkins/ci/plugins/jenkinslint/check/TimerTriggerChecker.java src/main/java/org/jenkins/ci/plugins/jenkinslint/model/AbstractAction.java src/main/java/org/jenkins/ci/plugins/jenkinslint/utils/StringUtils.java src/main/resources/org/jenkins/ci/plugins/jenkinslint/JenkinsLintGlobalConfiguration/config.jelly src/test/java/org/jenkins/ci/plugins/jenkinslint/check/HardcodedScriptCheckerTestCase.java src/test/java/org/jenkins/ci/plugins/jenkinslint/utils/StringUtilsTestCase.java http://jenkins-ci.org/commit/jenkinslint-plugin/7eaac06013567e6102618c3040b03a2dcbac548d Log: JENKINS-46146 Ignore commented lines in the HardcodedScript Checker, it's a global settings to be enabled/disabled globally (#29) Change-Id: I1ef684fc8007883fc1ccf8fa3f74ba63f5bb204b
          Hide
          v2v Victor Martinez added a comment -

          It will be released in the upcoming 0.12.0 version

          Show
          v2v Victor Martinez added a comment - It will be released in the upcoming 0.12.0 version
          Hide
          v2v Victor Martinez added a comment -

          Martin Jost, It's now supported in the latest release 0.12.0.

          Cheers

          Show
          v2v Victor Martinez added a comment - Martin Jost , It's now supported in the latest release 0.12.0. Cheers
          Hide
          martinjost Martin Jost added a comment -

          Hi Victor,

          thanks for the (next) update to Jenkins LINT.
          Works for me !

          Let me just emphasize:
          Me and Roberto now have opened 8 bug reports on Jenkins lint. (If I count correctly)
          That's not to say: "We don't like it, because it is so bug ridden."
          It's: "We really like it and we are using it actively - so we want these improvements in"

          Thanks a lot for all these fast improvements. It is appreciated !

          Martin

          Show
          martinjost Martin Jost added a comment - Hi Victor, thanks for the (next) update to Jenkins LINT. Works for me ! Let me just emphasize: Me and Roberto now have opened 8 bug reports on Jenkins lint. (If I count correctly) That's not to say: "We don't like it, because it is so bug ridden." It's: "We really like it and we are using it actively - so we want these improvements in" Thanks a lot for all these fast improvements. It is appreciated ! Martin
          Hide
          v2v Victor Martinez added a comment -

          Hi Martin, I do appreciate your feedback and time to raise those tickets, it's indeed awesome that you are using it and ask patiently to be improved/fixed. I do appreciate your time and effort since others will take for sure the benefits too.

          Thanks again 

          Show
          v2v Victor Martinez added a comment - Hi Martin, I do appreciate your feedback and time to raise those tickets, it's indeed awesome that you are using it and ask patiently to be improved/fixed. I do appreciate your time and effort since others will take for sure the benefits too. Thanks again 

            People

            • Assignee:
              v2v Victor Martinez
              Reporter:
              v2v Victor Martinez
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: