a follow-up of PR #762 to clean up all unnecessary import and reorder imports by PEP8
import
Flake8 is introduced here to validate the format(currently only for imports)
following modules are required here
pip install flake8 pip install flake8-import-order
to check format by flake8:
flake8 or make flake8
flake8
make flake8
BTW, currently, unittests code are skipped.
fixes: #1537
Current function of module requires cgi, so I would remove it from nested imports and leave on global level.
I would leave those explicit import for clarity (cli/koji except 'types') as they are directly used here. What would I rather like to see there (in future) is removal of import * from koji_cli.commands. It would be nice to somehow detect only command handlers (probably creating some import function handling functions in similar way as plugins)
If we're going to clean up the import here, might want to fix the ordering to follow pep8
6 new commits added
rebased onto a86176023c52106de4bf9bb9addfc6b4e2ac4774
I added a simple check by flake8. Do you have any suggestions to improve flake8 config?
@tkopecek updated. Please review again
You can now drop other import cgi throughout the file.
import cgi
If you leave import logging in top of file, these error messages needn't to be bypassed, not?
import logging
add OptionParser?
...and greetings
from . import context ?
urlgabber is not used anywhere AFAIK
@tkopecek Updated
1 new commit added
:thumbsup:
Fedora has isort, but not flake8-isort. I'd rather not require folks to pip install anything.
This flake8 config does not seem to work for me. When I simply run flake8, it does not appear to check any files.
[mike@localhost koji]$ flake8 -v|&grep Checking flake8.checker MainProcess 80 INFO Checking 0 files
rebased onto 8e4585306b6ab36ba1f12c311cbb7634c0d8b01c
Sorry for my mistake. flake8-isort is not required here
This flake8 config does not seem to work for me. When I simply run flake8, it does not appear to check any files. [mike@localhost koji]$ flake8 -v|&grep Checking flake8.checker MainProcess 80 INFO Checking 0 files
it works for me. here are my flake8 version and installed plugins
$ flake8 --version 3.5.0 (import-order: 0.16, mccabe: 0.6.1, pycodestyle: 2.3.1, pyflakes: 1.6.0) CPython 3.5.3 on Linux
rebased onto 54f7e8f982208815d008c6c23a67e8da81f56603
Issue #1537
@julian8628 - does it make sense to rebase this one?
rebased onto 84b6aa4ac2a8cf751633b5ce7fa94ac839eb86cf
@tkopecek updated
@mikem could you please check if .flake8 works for you now?
.flake8
rebased onto 8df617e4f4b037d713358bf12782f3aa3b7bd388
Config works for me.
Sorry, it needs another rebase (tests are failing due to broken merge).
rebased onto a00df18546b30146135c76659d4c57a3879fb86b
rebased
Commit 3c4377e8 fixes this pull-request
Pull-Request has been merged by tkopecek
Metadata Update from @julian8628: - Pull-request tagged with: no_qe
a follow-up of PR #762 to clean up all unnecessary
importand reorder imports by PEP8
Flake8 is introduced here to validate the format(currently only for imports)
following modules are required here
to check format by flake8:
flake8ormake flake8BTW, currently, unittests code are skipped.
fixes: #1537