mushorg / conpot

ICS/SCADA honeypot
GNU General Public License v2.0
1.21k stars 410 forks source link

Code style is not enforced #494

Closed srenfo closed 4 years ago

srenfo commented 4 years ago

The code has plenty of PEP 8 violations. That's not surprising given its size and its many authors.

For example, even ignoring line length, pycodestyle finds 300 violations on the current master:

$ pycodestyle bin/ conpot/ setup.py --ignore=E501 | wc
    300    2175   25226

There are plenty of tools to combat this, including pycodestyle/flake8, pylint, or black.

Suggestion: pick one and include it in the test suite.

The biggest issues is that the first changeset would be large.

I have some experience with those tools and can weigh in if desired.

xandfury commented 4 years ago

I really like black. Although we can just integrate something like codacy into our pipeline. That would also cover static analysis.

glaslos commented 4 years ago

Created a GitHub Action with black, let me know what you think.

glaslos commented 4 years ago

I run black fixing the styling issues. PR is here #501

srenfo commented 4 years ago

Created a GitHub Action with black, let me know what you think.

That's really cool.

You could add black --check conpot/ bin/ to tox.ini as well for local testing, but that would do the checks twice. I don't know if it's worthwhile. :shrug: