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

cpplint.py outputs not handled by Warnings plugin

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • warnings-plugin
    • Ubuntu 12.04

      I added an 'Execute shell' build step in Jenkins to run the cpplint.py

      python /var/lib/jenkins/scripts/cpplint.py --counting=detailed `find path -name *.cpp
      I also added 'Scan for compiler warnings' and added CppLint.

      However it always gets 0 warnings even though it displayed in the Console output some warnings such as

      filename.cpp:18: Missing space after , [whitespace/comma] [3]

          [JENKINS-18290] cpplint.py outputs not handled by Warnings plugin

          Ulli Hafner added a comment - - edited

          Seems that the syntax changed. Which cpp lint version are you using?

          Can you please attach a log with some more messages?

          Here the current format:

          c:\Workspace\Trunk\Project\P1\class.h(320):  At least two spaces is best between code and comments  [whitespace/comments] [2]
          c:\Workspace\Trunk\Project\P1\class.h(320):  Could not find a newline character at the end of the file.  [whitespace/ending_newline] [5]
          

          Ulli Hafner added a comment - - edited Seems that the syntax changed. Which cpp lint version are you using? Can you please attach a log with some more messages? Here the current format: c:\Workspace\Trunk\Project\P1\ class. h(320): At least two spaces is best between code and comments [whitespace/comments] [2] c:\Workspace\Trunk\Project\P1\ class. h(320): Could not find a newline character at the end of the file. [whitespace/ending_newline] [5]

          Gerard Kempff added a comment -

          I used the latest "cpplint.py" downloaded from "http://google-styleguide.googlecode.com/svn/trunk/cpplint/cpplint.py".

          It seems that there is an extra ":" in the latest message format and without the "()" around the line numbers, see below:

          /opt/ros/fuerte/stacks/Mule/Mapping/Local_map/src/LocalCostMap.cpp:399: Missing space before { [whitespace/braces] [5]
          /opt/ros/fuerte/stacks/Mule/Mapping/Local_map/src/LocalCostMap.cpp:400: Tab found; better to use spaces [whitespace/tab] [1]

          Thanks!

          Gerard Kempff added a comment - I used the latest "cpplint.py" downloaded from "http://google-styleguide.googlecode.com/svn/trunk/cpplint/cpplint.py". It seems that there is an extra ":" in the latest message format and without the "()" around the line numbers, see below: /opt/ros/fuerte/stacks/Mule/Mapping/Local_map/src/LocalCostMap.cpp:399: Missing space before { [whitespace/braces] [5] /opt/ros/fuerte/stacks/Mule/Mapping/Local_map/src/LocalCostMap.cpp:400: Tab found; better to use spaces [whitespace/tab] [1] Thanks!

          Gerard Kempff added a comment -

          Hi
          Is the information sufficient? Please let me know if you require something else.
          Thanks!

          Gerard Kempff added a comment - Hi Is the information sufficient? Please let me know if you require something else. Thanks!

          Ulli Hafner added a comment -

          Thanks, that is sufficient. The regualar expression needs to be improved to capture both formats...

          Ulli Hafner added a comment - Thanks, that is sufficient. The regualar expression needs to be improved to capture both formats...

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          src/main/java/hudson/plugins/warnings/parser/CppLintParser.java
          src/test/java/hudson/plugins/warnings/parser/CppLintParserTest.java
          src/test/resources/hudson/plugins/warnings/parser/issue18290.txt
          http://jenkins-ci.org/commit/warnings-plugin/1248c6e958d5ad2c58906043e522f337c813d947
          Log:
          [FIXED JENKINS-18290] Improved regexp of CPPLint parser.
          Now old and new formats could be parsed.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: src/main/java/hudson/plugins/warnings/parser/CppLintParser.java src/test/java/hudson/plugins/warnings/parser/CppLintParserTest.java src/test/resources/hudson/plugins/warnings/parser/issue18290.txt http://jenkins-ci.org/commit/warnings-plugin/1248c6e958d5ad2c58906043e522f337c813d947 Log: [FIXED JENKINS-18290] Improved regexp of CPPLint parser. Now old and new formats could be parsed.

            drulli Ulli Hafner
            gkempff Gerard Kempff
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: