Reduce number of flake/pep8 ignored rules.

Registered by Denis M. on 2013-12-09

Heat tox.ini has several ignored flake/pep8 rules. To make code more clean would be better to reduce it's numbers
 F841 local variable 'json_template' is assigned to but never used
 H201 no 'except:' at least use 'except Exception:'
 H302 import only modules.'bla..' does not import a module
 H306 imports not in alphabetical order
 H404 multi line docstring should start with a summary

First step - H201:
heat/db/sqlalchemy/migrate_repo/versions/015_grizzly.py:157:15: H201 no 'except:' at least use 'except Exception:'
        except:
              ^
heat/db/sqlalchemy/migrate_repo/versions/018_resource_id_uuid.py:35:11: H201 no 'except:' at least use 'except Exception:'
    except:
          ^
heat/engine/resource.py:414:15: H201 no 'except:' at least use 'except Exception:'
        except:
              ^
heat/engine/resource.py:638:15: H201 no 'except:' at least use 'except Exception:'
        except:
              ^
heat/engine/scheduler.py:242:31: H201 no 'except:' at least use 'except Exception:'
                        except:
                              ^
heat/engine/scheduler.py:257:19: H201 no 'except:' at least use 'except Exception:'
            except:
                  ^
heat/engine/scheduler.py:305:15: H201 no 'except:' at least use 'except Exception:'
        except:
              ^
heat/engine/scheduler.py:419:15: H201 no 'except:' at least use 'except Exception:'
        except:
              ^
heat/tests/test_engine_service.py:223:19: H201 no 'except:' at least use 'except Exception:'
            except:
                  ^
heat/tests/utils.py:69:15: H201 no 'except:' at least use 'except Exception:'
        except:
              ^
heat/tests/utils.py:107:15: H201 no 'except:' at least use 'except Exception:'
        except:

Blueprint information

Status:
Complete
Approver:
Steve Baker
Priority:
Undefined
Drafter:
None
Direction:
Approved
Assignee:
Pavlo Shchelokovskyy
Definition:
Approved
Series goal:
None
Implementation:
Implemented
Milestone target:
milestone icon 2014.2.2
Started by
Denis M. on 2013-12-09
Completed by
Angus Salkeld on 2015-02-03

Related branches

Sprints

Whiteboard

(stevebaker) Please enable each rule in a separate git change. You should expect push-back on some rules from reviewers, possibly with -2s. H201 will require some very careful testing. H404 has been rejected in the past. There are times where being able to do F841 is useful.

Gerrit topic: https://review.openstack.org/#q,topic:bp/reduce-flake8-ignored-rules,n,z

Addressed by: https://review.openstack.org/71511
    Order imports in alphabetical order (1/9)

Addressed by: https://review.openstack.org/71512
    Order imports in alphabetical order (2/9)

Addressed by: https://review.openstack.org/71513
    Order imports in alphabetical order (3/9)

Addressed by: https://review.openstack.org/71514
    Order imports in alphabetical order (4/9)

Addressed by: https://review.openstack.org/71515
    Order imports in alphabetical order (5/9)

Addressed by: https://review.openstack.org/71516
    Order imports in alphabetical order (6/9)

Addressed by: https://review.openstack.org/71517
    Order imports in alphabetical order (7/9)

Addressed by: https://review.openstack.org/71518
    Order imports in alphabetical order (8/9)

Addressed by: https://review.openstack.org/73519
    Update common docstrings to match guidelines

Addressed by: https://review.openstack.org/73070
    Update contrib docstrings to match guidelines

Addressed by: https://review.openstack.org/85361
    Order imports in alphabetical order (9/9)

Gerrit topic: https://review.openstack.org/#q,topic:bp/reduce-flake8-ignore-rules,n,z

Addressed by: https://review.openstack.org/102778
    Fix H201 violations and re-enable gating

(pshchelo) As this is in principle a never-ending topic :) I propose to close this blueprint as the number of ignored rules is clearly reduced already down to only 3 non-code related ones [1]. Whe moved to the newer "hacking" checks (with more and better checks), and currenlty ignore only 2 checks about multiline docstring formatting, and one about the commit message formatting, the code itself is completely checked.

[1] https://github.com/openstack/heat/blob/30f7afb4e0039aea1197032ae5156eef4b404ff8/tox.ini#L58

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.