Skip to content

Commit

Permalink
Updating docs on PyLint
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasbjerre committed May 3, 2018
1 parent fa6c38a commit 4016805
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ It supports:
* [_PerlCritic_](https://github.com/Perl-Critic)
* [_PiTest_](http://pitest.org/)
* [_PyDocStyle_](https://pypi.python.org/pypi/pydocstyle)
* [_PyLint_](https://www.pylint.org/)
* [_PyLint_](https://www.pylint.org/) with `pylint --output-format=parseable`.
* [_PMD_](https://pmd.github.io/)
* [_Infer_](http://fbinfer.com/) Facebook Infer. With `--pmd-xml`.
* [_PHPPMD_](https://phpmd.org/) with `phpmd api.php xml ruleset.xml`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,20 @@

import java.util.ArrayList;
import java.util.List;

import se.bjurr.violations.lib.model.SEVERITY;
import se.bjurr.violations.lib.model.Violation;

/**
* PyLint.<br>
* <code>
* pylint --output-format=parseable --reports=n voluptuous
* pylint --output-format=parseable
* </code>
*/
public class PyLintParser implements ViolationsParser {

@Override
public List<Violation> parseReportOutput(String string) throws Exception {
public List<Violation> parseReportOutput(final String string) throws Exception {
final List<Violation> violations = new ArrayList<>();
final List<List<String>> partsPerLine =
getLines(string, "([^:]*):(\\d+): \\[(\\D)(\\d*)\\(([^\\]]*)\\), ([^\\]]*)] (.*)");
Expand Down
16 changes: 16 additions & 0 deletions src/test/resources/pylint/pylint3.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
$ pylint3 packages/myproject/
No config file found, using default configuration
************* Module packages.myproject.main
C: 15, 0: Invalid constant name "logger" (invalid-name)
C: 31, 0: Invalid argument name "rt" (invalid-name)
************* Module packages.myproject.feed
C: 34, 0: Line too long (116/100) (line-too-long)
C: 35, 0: Trailing whitespace (trailing-whitespace)
C: 74, 0: Exactly one space required before assignment
unsed4= "jdajhkadshjkdaskhjdsahj"
^ (bad-whitespace)
C:131, 0: Exactly one space required after assignment
hello =4
^ (bad-whitespace)
C:132, 0: Trailing whitespace (trailing-whitespace)
C:132, 0: Line too long (102/100) (line-too-long)

0 comments on commit 4016805

Please sign in to comment.