1

I currently have a project that I'm using pylint and pytest. I use Travis to validate my build, and also run pylint to verify the code quality.

But I wanted to do something different and not finding anywhere about how I should proceed. I want my Travis build to break if the code rating is below 9.5, not even running the pytest script. Therefore I can guarantee that all the guidelines are being followed.

What can I do to trigger this? Do I have to configure my .travis.yml or pylintrc?

porthunt
  • 484
  • 1
  • 5
  • 12

1 Answers1

0

I see two ways to go about this:

  • write your own reporter for pylint that exits with something non-zero when the report score is below the threshold. custom reporter
  • hook into/extend the pytest-pylint plugin. Which already has programmatic access to the linter run. pylint-pytest code (runs before the actual pytest tests)
renefritze
  • 2,167
  • 14
  • 25