hudson.plugins.violations.types.perlcritic
Class PerlCriticParser

java.lang.Object
  extended by hudson.plugins.violations.types.perlcritic.PerlCriticParser
All Implemented Interfaces:
ViolationsParser

public class PerlCriticParser
extends java.lang.Object
implements ViolationsParser

Parser for parsing Perl::Critic reports. The parser supports stock Perl::Critic output, without output-modifying option flags (e.g.: `perlcritic --brutal .`). Also adapted from the pylint parser

Author:
David McGuire

Constructor Summary
PerlCriticParser()
          Constructor - compile the regex to a Pattern.
 
Method Summary
 void parse(FullBuildModel model, java.io.File projectPath, java.lang.String fileName, java.lang.String[] sourcePaths)
          Parse a violations file.
 void parseLine(FullBuildModel model, java.lang.String line, java.io.File projectPath)
          Parses a Perl::Critic line and adds a Violation if this.pattern matches
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PerlCriticParser

public PerlCriticParser()
Constructor - compile the regex to a Pattern.

Method Detail

parse

public void parse(FullBuildModel model,
                  java.io.File projectPath,
                  java.lang.String fileName,
                  java.lang.String[] sourcePaths)
           throws java.io.IOException
Parse a violations file.

Specified by:
parse in interface ViolationsParser
Parameters:
model - the model to store the violations in.
projectPath - the project path used for resolving paths.
fileName - the name of the violations file to parse (relative to the projectPath).
sourcePaths - a list of source paths to resolve classes against
Throws:
java.io.IOException - if there is an error.

parseLine

public void parseLine(FullBuildModel model,
                      java.lang.String line,
                      java.io.File projectPath)
Parses a Perl::Critic line and adds a Violation if this.pattern matches

Parameters:
model - build model to which violations should be added
line - the line in the source file on which violation occurred
projectPath - the project path to use to resolve the source file


Copyright © 2004-2012. All Rights Reserved.