You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Jiri Daněk (Jira)" <ji...@apache.org> on 2021/02/21 11:18:00 UTC

[jira] [Commented] (DISPATCH-1814) Apply autofixes to resolve some flake8 code formatting issues

    [ https://issues.apache.org/jira/browse/DISPATCH-1814?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17287919#comment-17287919 ] 

Jiri Daněk commented on DISPATCH-1814:
--------------------------------------

Better command, which respects the unpythonic vertical alignment now present in some source files:

{noformat}
git ls-tree -r --name-only HEAD | egrep '.*\.py(.in)?' | xargs autopep8 --in-place --max-line-length 200 --ignore=E226,E24,W50,W690,E203,E221,E222
git ls-tree -r --name-only HEAD | egrep 'tools/.*\.in' | xargs autopep8 --in-place --max-line-length 200 --ignore=E226,E24,W50,W690,E203,E221,E222
{noformat}

The ignores are default autopep8 ignores, plus

{noformat}
E203 whitespace before ':'
E221 multiple spaces before operator
E222 multiple spaces after operator
{noformat}

> Apply autofixes to resolve some flake8 code formatting issues
> -------------------------------------------------------------
>
>                 Key: DISPATCH-1814
>                 URL: https://issues.apache.org/jira/browse/DISPATCH-1814
>             Project: Qpid Dispatch
>          Issue Type: Task
>    Affects Versions: 1.14.0
>            Reporter: Jiri Daněk
>            Assignee: Jiri Daněk
>            Priority: Trivial
>             Fix For: 1.16.0
>
>
> The general strategy for dealing with these in a scalable manner could be as follows
> Identify warning we want to resolve, e.g. E701 multiple statements on a single line.
> Remove E701 from flake8 ignore list in {{tests/tox.ini.in}}.
> Run the autofixer
> {code}
> pip install autopep8
> for f in `find -name "*.py"`; do autopep8 --in-place --select=E701 $f; done
> for f in `find tests -name "*.py.in"`; do autopep8 --in-place --select=E701 $f; done
> autopep8 --in-place --select=E701 tools/*.in
> {code}
> Wait about two minutes.
> Review the diffs produced.
> Submit a change request.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org