#708 Apply PEP 8 to all python code
Closed: Fixed None Opened 10 years ago by mharmsen.

During the development process, the Python code is no longer in compliance with PEP 8 (http://www.python.org/dev/peps/pep-0008).

For example, line length does not comply with http://www.python.org/dev/peps/pep-0008/#maximum-line-length.


PEP8-tification is an intrusive task. In my experience it often causes conflicts with active patches and feature branches. The task should be coordinated with all developers.

The autopep8 tool is a good tool to automate most of the boring tasks. It's not perfect but it does 95% of the job in a matter of seconds. https://pypi.python.org/pypi/autopep8

Once we have archived PEP8 compliance, flake8 and two additional plugins can ensure that Dogtag stays PEP8 conform:

- https://pypi.python.org/pypi/flake8
- https://pypi.python.org/pypi/flake8-import-order
- https://pypi.python.org/pypi/pep8-naming

I have attached a patch which I generated with autopep8

   $ find base/ -name '*.py' | xargs autopep8 --diff --ignore E309 --aggressive

The auto-generated patch isn't perfect, but itaddresses most PEP8 violations. Some lines need manual improvements, too.

Moving to 'critical' so that this is addressed early for 10.3.

Pushed to master in 12badcabc1cd345256a4902f7b0583cf667ecd8d

Metadata Update from @mharmsen:
- Issue assigned to cheimes
- Issue set to the milestone: 10.3.0

7 years ago

Dogtag PKI is moving from Pagure issues to GitHub issues. This means that existing or new
issues will be reported and tracked through Dogtag PKI's GitHub Issue tracker.

This issue has been cloned to GitHub and is available here:
https://github.com/dogtagpki/pki/issues/1277

If you want to receive further updates on the issue, please navigate to the
GitHub issue and click on Subscribe button.

Thank you for understanding, and we apologize for any inconvenience.

Login to comment on this ticket.

Metadata