Implement pep8 hacking checks

Bug #1704691 reported by Ngo Quoc Cuong
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuxi
Fix Released
Undecided
Ngo Quoc Cuong

Bug Description

Currently, fuxi does not have pep8 hacking checks. As the result of it, there is a lot code does not follow OpenStack recommended code conventions, such as:

- [N521] Validate that jsonutils module is used instead of json
- [N529] Method's default argument shouldn't be mutable
- [N537] Don't translate logs.

We should add pep8 hacking checks implementation to clean up the code and more importantly, prevent future mistakes.

Changed in fuxi:
assignee: nobody → Ngo Quoc Cuong (cuongnq)
description: updated
Changed in fuxi:
status: New → In Progress
Revision history for this message
Ngo Quoc Cuong (cuongngoquoc) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuxi (master)

Reviewed: https://review.openstack.org/482023
Committed: https://git.openstack.org/cgit/openstack/fuxi/commit/?id=f4fbbc177036ef7b88e48889461dfc049e26aa36
Submitter: Jenkins
Branch: master

commit f4fbbc177036ef7b88e48889461dfc049e26aa36
Author: Ngo Quoc Cuong <email address hidden>
Date: Mon Jul 10 02:55:20 2017 -0400

    Fix N529 Method's default argument should not be mutable

    See:
    [1] http://python-guide-pt-br.readthedocs.io/en/latest/writing/gotchas/#mutable-default-arguments

    Partial-Bug: #1704691

    Change-Id: Ibd202f1970a6138299648040f635278ba9d9d71b

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuxi (master)

Fix proposed to branch: master
Review: https://review.openstack.org/484276

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuxi (master)

Reviewed: https://review.openstack.org/484276
Committed: https://git.openstack.org/cgit/openstack/fuxi/commit/?id=17a3b259213b7267573bb6c9adbf38c84914db2d
Submitter: Jenkins
Branch: master

commit 17a3b259213b7267573bb6c9adbf38c84914db2d
Author: Ngo Quoc Cuong <email address hidden>
Date: Mon Jul 17 03:44:33 2017 -0400

    Reuse neutron-lib for pep8 hacking checks

    neutron library has a good hacking rules set, we can use these rules
    instead of reinvent the wheel. These such rules are:

    - [N521] Validate that jsonutils module is used instead of json
    - [N532] Validate that LOG.warning is used instead of LOG.warn. The
             latter is deprecated.
    - [N537] Don't translate logs.
    - [N534] Exception messages should be translated

    It also enables H904, which allows the logging package to skip
    creating the formatted log message if the message is not going
    to be emitted because of the current log level.

    Change-Id: I3b3649bbe8a7a3ae69d3ea1553923567b5a350d7
    Closes-Bug: #1704691

Changed in fuxi:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.