Tool for checking unused imports needed

Bug #1157597 reported by Zhongyue Luo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo-incubator
Fix Released
Medium
Zhongyue Luo

Bug Description

Currently there are some unused imports in the upstream codebase.

************* Module tests.utils
W: 20,0: Unused import subprocess
************* Module tests.unit.test_plugin
W: 18,0: Unused import cfg
************* Module tests.unit.test_notifier
W: 23,0: Unused import rabbit_notifier
************* Module tests.unit.test_version
...

Instead of conducting janitorial cleanups every now and then we should have pylint check for unused imports for each patch.

Therefore adding a python script that executes pylint and a pylint section to tox.ini should prevent unused imports perminantly.

The reason writing a script is for flexible configuration of pylint which would be useful for adding exceptions in the future.

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

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

Changed in oslo:
assignee: nobody → Zhongyue Luo (zyluo)
status: New → In Progress
Zhongyue Luo (zyluo)
description: updated
Revision history for this message
Doug Hellmann (doug-hellmann) wrote :

Monty Taylor is working on flake8 support across all projects.

Revision history for this message
Zhongyue Luo (zyluo) wrote :

I sent a mail to Monty about his plans with flake8

Mark McLoughlin (markmc)
Changed in oslo:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo-incubator (master)

Reviewed: https://review.openstack.org/24882
Committed: http://github.com/openstack/oslo-incubator/commit/4bb00aa8f0e7fb7181ffe6299dfd2a31b860e5c1
Submitter: Jenkins
Branch: master

commit 4bb00aa8f0e7fb7181ffe6299dfd2a31b860e5c1
Author: Zhongyue Luo <email address hidden>
Date: Wed Mar 20 15:48:26 2013 +0800

    Adds pylint section in tox.ini to check for unused imports

    Fixes bug #1157597

    Change-Id: I77e0ddb1babf1eec0bb953b8bfa52cd1d415f709

Changed in oslo:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in oslo:
milestone: none → havana-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in oslo:
milestone: havana-1 → 2013.2
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.