use of hudson.plugins.violations.model.FullFileModel in project violations-plugin by jenkinsci.
the class PyLintParser method parseLine.
/**
* Parses a PyLint line and adding a violation if regex
*
* @param model
* build model to add violations to
* @param line
* the line in the file.
* @param projectPath
* the path to use to resolve the file.
*/
public void parseLine(FullBuildModel model, String line, File projectPath) {
PyLintViolation pyLintViolation = getPyLintViolation(line);
if (pyLintViolation != null) {
Violation violation = new Violation();
violation.setType("pylint");
violation.setLine(pyLintViolation.getLineStr());
violation.setMessage(pyLintViolation.getMessage());
violation.setSource(pyLintViolation.getViolationId());
setServerityLevel(violation, pyLintViolation.getViolationId());
FullFileModel fileModel = getFileModel(model, pyLintViolation.getFileName(), absoluteFileFinder.getFileForName(pyLintViolation.getFileName()));
fileModel.addViolation(violation);
}
}
use of hudson.plugins.violations.model.FullFileModel in project violations-plugin by jenkinsci.
the class ZptlintParser method parseLine.
/**
* Parses a Zptlint line and adding a violation if regex
*
* @param model
* build model to add violations to
* @param line
* the line in the file.
* @param projectPath
* the path to use to resolve the file.
*/
public void parseLine(FullBuildModel model, String line, File projectPath) {
ZptlintViolation zptlintViolation = getZptlintViolation(line);
if (zptlintViolation != null) {
Violation violation = new Violation();
violation.setType("zptlint");
violation.setLine(zptlintViolation.getLineStr());
violation.setMessage(zptlintViolation.getMessage());
violation.setSource(zptlintViolation.getViolationId());
setServerityLevel(violation, zptlintViolation.getViolationId());
FullFileModel fileModel = getFileModel(model, zptlintViolation.getFileName(), absoluteFileFinder.getFileForName(zptlintViolation.getFileName()));
fileModel.addViolation(violation);
}
}
use of hudson.plugins.violations.model.FullFileModel in project violations-plugin by jenkinsci.
the class Pep8Parser method getFileModel.
private FullFileModel getFileModel(FullBuildModel model, String name, File sourceFile) {
FullFileModel fileModel = model.getFileModel(name);
File other = fileModel.getSourceFile();
if (sourceFile == null || ((other != null) && (other.equals(sourceFile) || other.exists()))) {
return fileModel;
}
fileModel.setSourceFile(sourceFile);
fileModel.setLastModified(sourceFile.lastModified());
return fileModel;
}
use of hudson.plugins.violations.model.FullFileModel in project violations-plugin by jenkinsci.
the class XmllintParser method getFileModel.
private FullFileModel getFileModel(FullBuildModel model, String name, File sourceFile) {
FullFileModel fileModel = model.getFileModel(name);
File other = fileModel.getSourceFile();
if (sourceFile == null || ((other != null) && (other.equals(sourceFile) || other.exists()))) {
return fileModel;
}
fileModel.setSourceFile(sourceFile);
fileModel.setLastModified(sourceFile.lastModified());
return fileModel;
}
use of hudson.plugins.violations.model.FullFileModel in project violations-plugin by jenkinsci.
the class CppLintParser method getFileModel.
private FullFileModel getFileModel(FullBuildModel model, String name, File sourceFile) {
FullFileModel fileModel = model.getFileModel(name);
File other = fileModel.getSourceFile();
if (sourceFile == null || ((other != null) && (other.equals(sourceFile) || other.exists()))) {
return fileModel;
}
fileModel.setSourceFile(sourceFile);
fileModel.setLastModified(sourceFile.lastModified());
return fileModel;
}
Aggregations