How would I start integrating pyflakes with Hudson
Asked Answered
P

3

8

We use Hudson for continuous integration with the Violations Plugin which parses our output from pylint. However, pylint is a bit too strict, and hard to configure. What we'd rather use is pyflakes which would give us the right level of "You're doing it wrong."

Padauk answered 13/3, 2010 at 0:46 Comment(0)
B
4

You can adapt pyflakes and pep8 output to work with the Violations pylint plugin.

pyflakes path/to/src | awk -F\: '{printf "%s:%s: [E]%s\n", $1, $2, $3}' > violations.pyflakes.txt

pep8 path/to/src | awk -F\: '{printf "%s:%s: [%s]%s\n", $1, $2, substr($4,2,4), substr($4,6)}' > violations.pep8.txt

You could use a regex or concatenate the output to generate a report that includes multiple metrics.

For more details see http://hustoknow.blogspot.com/2011/01/integration-pyflakes-into-hudson.html

Bagdad answered 24/3, 2011 at 22:16 Comment(1)
I would expect it tooBagdad
B
1

The Violations plugin requires xml output from the various checkers that it supports.

I'm not familiar with pyflakes, but from my brief scan, it doesn't appear to support xml as an output type. So you'll have to post-process the pyflakes output before letting Violations try to parse it (or you could modify pyflakes and write your own Message output class). You'll probably want to capture the pylint output and use that to figure out the appropriate xml format that the Violations plugin likes.

Billibilliard answered 13/3, 2010 at 1:15 Comment(0)
E
0

The Violations plugin requires xml output from the various checkers

This is wrong: Some checkers like "checkstyle" output XML, some others like "pylint" and "pep8" output "text" files with one record per line. The heading in Jenkins "XML filename pattern" is plain misleading.

Ethnarch answered 21/12, 2015 at 13:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.