"tox -e lint" fails on the master branch

Bug #1833093 reported by Alex Kavanagh
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
logrotate-charm
Fix Released
Low
Diko Parvanov

Bug Description

Running "tox -e lint" in the master branch fails with lots of errors:

On master:
tox -e lint | wc -l
155

i.e. around 155 link or lint related errors. the few from the top and bottom are:

$ tox -e lint
lint installed: entrypoints==0.3,flake8==3.7.7,flake8-colors==0.1.6,flake8-docstrings==1.3.0,flake8-import-order==0.18.1,flake8-polyfill==1.0.2,mccabe==0.6.1,pep8-naming==0.8.2,pkg-resources==0.0.0,pycodestyle==2.5.0,pydocstyle==3.0.0,pyflakes==2.1.1,six==1.12.0,snowballstemmer==1.2.1
lint runtests: PYTHONHASHSEED='2352227386'
lint runtests: commands[0] | flake8
./tests/functional/conftest.py:2:1: D300 Use """triple double quotes"""
./tests/functional/conftest.py:2:1: D400 First line should end with a period
./tests/functional/conftest.py:15:1: I201 Missing newline between import groups. 'import pytest' is identified as Third Party and 'import uuid' is identified as Stdlib.
./tests/functional/conftest.py:16:1: I100 Import statements are in the wrong order. 'import subprocess' should be before 'import pytest' and in a different group.
./tests/functional/conftest.py:16:1: I201 Missing newline between import groups. 'import subprocess' is identified as Stdlib and 'import pytest' is identified as Third Party.
./tests/functional/conftest.py:19:1: I201 Missing newline between import groups. 'from juju_tools import JujuTools' is identified as Third Party and 'from juju.controller import Controller' is identified as Third Party.
./tests/functional/conftest.py:24:1: D205 1 blank line required between summary line and description
./tests/functional/conftest.py:24:1: D209 Multi-line docstring closing quotes should be on a separate line
./tests/functional/conftest.py:24:1: D300 Use """triple double quotes"""
./tests/functional/conftest.py:24:1: D400 First line should end with a period
./tests/functional/conftest.py:36:1: D300 Use """triple double quotes"""
./tests/functional/conftest.py:36:1: D400 First line should end with a period

...

./reactive/logrotate.py:3:1: I100 Import statements are in the wrong order. 'from charmhelpers.core import hookenv' should be before 'from lib_cron import CronHelper' and in a different group.
./reactive/logrotate.py:3:1: I201 Missing newline between import groups. 'from charmhelpers.core import hookenv' is identified as Third Party and 'from lib_cron import CronHelper' is identified as Third Party.
./reactive/logrotate.py:4:1: I201 Missing newline between import groups. 'from charms.reactive import set_flag, when, when_not' is identified as Third Party and 'from charmhelpers.core import hookenv' is identified as Third Party.
./reactive/logrotate.py:9:1: E302 expected 2 blank lines, found 1
./reactive/logrotate.py:10:1: D103 Missing docstring in public function
./reactive/logrotate.py:11:26: E703 statement ends with a semicolon
./reactive/logrotate.py:17:27: E703 statement ends with a semicolon
./reactive/logrotate.py:19:1: E302 expected 2 blank lines, found 1
./reactive/logrotate.py:20:1: D103 Missing docstring in public function
./reactive/logrotate.py:27:27: E703 statement ends with a semicolon
./reactive/logrotate.py:29:1: E302 expected 2 blank lines, found 1
./reactive/logrotate.py:29:1: D103 Missing docstring in public function
./reactive/logrotate.py:34:8: E111 indentation is not a multiple of four
./reactive/logrotate.py:35:8: E111 indentation is not a multiple of four
./reactive/logrotate.py:36:8: E111 indentation is not a multiple of four
ERROR: InvocationError: '/home/alex/Projects/Canonical/other/logrotate-charm/.tox/lint/bin/flake8'
__________________________________________________________ summary ___________________________________________________________
ERROR: lint: commands failed

The lint (flake8) measure conformance to accepted standards in the Python community for Python code, and these standards are those which (are thought to) indicate that the code is easy to read, maintainable and likely to have fewer bugs.

Unfortunately, without a solid baseline in master, it's difficult/impossible to say whether a new merge proposal is improving or reducing the tastefulness of the code and whether it conforms with the 'standard' approach./

Related branches

Diko Parvanov (dparv)
Changed in logrotate-charm:
status: New → Confirmed
assignee: nobody → Diko Parvanov (dparv)
importance: Undecided → Low
Revision history for this message
Diko Parvanov (dparv) wrote :
Diko Parvanov (dparv)
Changed in logrotate-charm:
status: Confirmed → Fix Committed
Revision history for this message
Alex Kavanagh (ajkavanagh) wrote :

This is not fixed in master. It might be fixed in a branch, but it's not yet committed to master; I've just pulled master and it's still failing.

Changed in logrotate-charm:
status: Fix Committed → In Progress
Revision history for this message
Diko Parvanov (dparv) wrote :

@Alex, it should be fine now.

Changed in logrotate-charm:
status: In Progress → Fix Committed
Diko Parvanov (dparv)
Changed in logrotate-charm:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.