• Icon: Patch Patch
    • Resolution: Fixed
    • Icon: Minor Minor
    • violations-plugin
    • None

      I adapted the pylint parser into a pep8 <http://pypi.python.org/pypi/pep8> parser. Here is a patch with this feature.

          [JENKINS-7728] Pep8 support for Violations plugin

          ali_rantakari added a comment - - edited

          Added patch as SVN diff

          ali_rantakari added a comment - - edited Added patch as SVN diff

          ali_rantakari added a comment - - edited

          Note that this is a pretty straightforward patch where the bulk of the pep8 parser code is copy-pasted directly from the pylint parser. A better way to do this would be to implement an abstract regex-based parser which both the pylint and the pep8 parsers would then extend, defining their particular regexes, the mapping of regex group indexes to violation fields and the mapping of message types to violation severity values.

          I am willing to implement this improvement if the maintainer(s) can give me an idea as to where this abstract parser superclass should be placed (it looks like hudson.plugins.violations.parse would be the package for this but I'd like a green light nonetheless).

          ali_rantakari added a comment - - edited Note that this is a pretty straightforward patch where the bulk of the pep8 parser code is copy-pasted directly from the pylint parser. A better way to do this would be to implement an abstract regex-based parser which both the pylint and the pep8 parsers would then extend, defining their particular regexes, the mapping of regex group indexes to violation fields and the mapping of message types to violation severity values. I am willing to implement this improvement if the maintainer(s) can give me an idea as to where this abstract parser superclass should be placed (it looks like hudson.plugins.violations.parse would be the package for this but I'd like a green light nonetheless).

          Code changed in jenkins
          User: cactusman
          Path:
          src/main/java/hudson/plugins/violations/TypeDescriptor.java
          src/main/java/hudson/plugins/violations/types/pep8/Pep8Descriptor.java
          src/main/java/hudson/plugins/violations/types/pep8/Pep8Parser.java
          src/test/java/hudson/plugins/violations/types/pep8/Pep8ParserTest.java
          http://jenkins-ci.org/commit/violations-plugin/30a4cb1ca63804e040e0009c48f325673477b2fa
          Log:
          [FIXED JENKINS-7728]

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: cactusman Path: src/main/java/hudson/plugins/violations/TypeDescriptor.java src/main/java/hudson/plugins/violations/types/pep8/Pep8Descriptor.java src/main/java/hudson/plugins/violations/types/pep8/Pep8Parser.java src/test/java/hudson/plugins/violations/types/pep8/Pep8ParserTest.java http://jenkins-ci.org/commit/violations-plugin/30a4cb1ca63804e040e0009c48f325673477b2fa Log: [FIXED JENKINS-7728]

          Code changed in jenkins
          User: cactusman
          Path:
          src/main/java/hudson/plugins/violations/TypeDescriptor.java
          src/main/java/hudson/plugins/violations/types/pep8/Pep8Descriptor.java
          src/main/java/hudson/plugins/violations/types/pep8/Pep8Parser.java
          src/test/java/hudson/plugins/violations/types/pep8/Pep8ParserTest.java
          http://jenkins-ci.org/commit/violations-plugin/30a4cb1ca63804e040e0009c48f325673477b2fa
          Log:
          [FIXED JENKINS-7728]

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: cactusman Path: src/main/java/hudson/plugins/violations/TypeDescriptor.java src/main/java/hudson/plugins/violations/types/pep8/Pep8Descriptor.java src/main/java/hudson/plugins/violations/types/pep8/Pep8Parser.java src/test/java/hudson/plugins/violations/types/pep8/Pep8ParserTest.java http://jenkins-ci.org/commit/violations-plugin/30a4cb1ca63804e040e0009c48f325673477b2fa Log: [FIXED JENKINS-7728]

          cactusman added a comment -

          I patched pep8.diff

          cactusman added a comment - I patched pep8.diff

            cactusman cactusman
            ali_rantakari ali_rantakari
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: