Bitcoin-ABC/ElectrumABC

[lint] fix flake8 warnings and don't ignore them

Closed this issue · 2 comments

PiRK commented

This is a list of flake8 error flags that are currently not enforced, but should be.

Easy to fix:

  • E262 inline comment should start with ‘# ‘. Done in #255
  • E265 block comment should start with ‘# ‘. Done in #255
  • E266 too many leading ‘#’ for block comment
  • E731 do not assign a lambda expression, use a def
  • E741 do not use variables named ‘l’, ‘O’, or ‘I’

Less easy:

  • E501 line too long (> 88 characters): investigate what black allows to fix. Sometimes related to #248?
  • E402 module level import not at top of file (sometimes there is a good reason, such as working around a circular dependency). Done in #255
  • E722 do not use bare except, specify exception instead (requires finding which specific errors are reasonable to catch in each situation)

See:

PiRK commented

See #251 and #39 for examples of running flake8 and adding error codes to continuous integration via pre-commit.

See https://github.com/Bitcoin-ABC/ElectrumABC/blob/master/CONTRIBUTING.md for more contribution guidelines, including some info about setting-up pre-commit

PiRK commented

E722 cannot be done properly in a reasonable amount of time, so I only did the basic except: -> except Exception: fix for now.