canonical / charm-logrotated

logrotate is a subordinate charm that ensure that all logrotate.d configurations within /etc/logrotate.d/ folder are modified accordingly to a retention period defined in the charm
Other
0 stars 2 forks source link

"tox -e lint" fails on the master branch #21

Closed jneo8 closed 10 months ago

jneo8 commented 10 months ago

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, whennot' 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./


Imported from Launchpad using lp2gh.

jneo8 commented 10 months ago

(by dparv) Proposed MR for bugfix: https://code.launchpad.net/~logrotate-charmers/logrotate-charm/+git/logrotate-charm/+ref/bugs_1833095_1833093

jneo8 commented 10 months ago

(by ajkavanagh) 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.

jneo8 commented 10 months ago

(by dparv) Alex, it should be fine now.