#2049 extending flake8 rules
Merged by mikem. Opened by julian8628.
julian8628/koji flake8  into  master

Download 2049.patch

applied E,F,W,C,I rules except

# too many leading ‘#’ for block comment
E266,
# do not assign a lambda expression, use a def
E731,
# [PY2] list comprehension redefines `name` from line `N`
F812,
# line break after binary operator
W504

and the max-line-length is 99 for now

most of code changes are made by autopep8 except line length change, etc, as it looks ugly at some places.

testing code are excluded still.

fixes: #2050

questionable change is except: -> except BaseException:

It could be improved by Exception at some places or leave it as is.

@tkopecek @mikem

1 new commit added

  • flake8: ignore F812 rule for PY2

20 new commits added

  • flake8: ignore F812 rule for PY2
  • flake8: update contribution guide for flake8
  • add test-requirements.txt to install testing related modules by pip
  • flake8: apply all rules after rebasing
  • flake8: apply W rules (prefering W503)
  • flake8: apply E501 with max-line-length=99
  • flake8: apply all rest E7 rules
  • flake8: apply E71x rule
  • flake8: apply E70x rule
  • flake8: apply E501 rule
  • flake8: apply E4 rules and ignore E402 in sidetag_hub plugin
  • flake8: apply E3 rules
  • flake8: apply E2 rules except E266
  • flake8: apply E1 rules
  • flake8: apply E265 for util/koji-*
  • flake8: apply F rules for koji-shadow
  • refine import style
  • flake8: util/koji-* were ignored
  • flake8: follow E265 rule
  • flake8: follow all F rules

There is a lot of error messages now (30 types). Is it still WIP?

No. And there's no error on my local. Here is my flake8 (python3 ver)

$ flake8 --version
3.7.9 (import-order: 0.18.1, mccabe: 0.6.1, pycodestyle: 2.5.0, pyflakes: 2.1.1) CPython 3.6.6 on Linux

Ah, my fault. I've had old checkout in the directory, which caused all the errors.

I would change BaseException to Exception as you've proposed. Otherwise it looks good. I've added issue to 1.21. It is a huge but simple PR and rebasing it later could be costly.

:thumbsup:

1 new commit added

  • use Exception instead of BaseException for bare expection

1 new commit added

  • still use BaseException for logging purpose

updated

55a3f8c7 is still using BaseException for logging purpose before exit

rebased onto 6b92ff7b1ae1dd02f5164ca5588014f371887386

23 new commits added

  • flake8: apply rules for koji-sidetag-cleanup
  • still use BaseException for logging purpose
  • use Exception instead of BaseException for bare expection
  • flake8: ignore F812 rule for PY2
  • flake8: update contribution guide for flake8
  • add test-requirements.txt to install testing related modules by pip
  • flake8: apply all rules after rebasing
  • flake8: apply W rules (prefering W503)
  • flake8: apply E501 with max-line-length=99
  • flake8: apply all rest E7 rules
  • flake8: apply E71x rule
  • flake8: apply E70x rule
  • flake8: apply E502 rule
  • flake8: apply E4 rules and ignore E402 in sidetag_hub plugin
  • flake8: apply E3 rules
  • flake8: apply E2 rules except E266
  • flake8: apply E1 rules
  • flake8: apply E265 for util/koji-*
  • flake8: apply F rules for koji-shadow
  • refine import style
  • flake8: util/koji-* were ignored
  • flake8: follow E265 rule
  • flake8: follow all F rules

rebased onto 642508ccf6ad2c966e730809e4a6dbaf1364f381

:thumbsup:

Commit 25fb4e67 fixes this pull-request

Pull-Request has been merged by mikem

Metadata