Remove pyflakes_bypass

There are valid pythonic ways to address all of the complaints that
pyflakes made in the past.

Fixes bug #1171420

Change-Id: Idf145185ebb4df237fff887365fa0c48d3603025
This commit is contained in:
Clint Byrum 2013-04-22 11:03:18 -07:00 committed by Gerrit Code Review
parent c8711ce650
commit 7ce9a214f0
7 changed files with 1 additions and 24 deletions

View File

@ -29,7 +29,6 @@ from heat.common import identifier
from heat.engine import parameters from heat.engine import parameters
from heat.engine import parser from heat.engine import parser
from heat.engine import resource from heat.engine import resource
from heat.engine import resources # pyflakes_bypass review 23102
from heat.engine import watchrule from heat.engine import watchrule
from heat.openstack.common import log as logging from heat.openstack.common import log as logging

View File

@ -28,9 +28,7 @@ def reset_db():
def setup(): def setup():
import mox # pyflakes_bypass Workaround for bug 810424
from heat.db import migration from heat.db import migration
from heat import db # pyflakes_bypass review 23102
reset_db() reset_db()
migration.db_sync() migration.db_sync()

View File

@ -20,8 +20,6 @@ from nose.plugins.attrib import attr
from oslo.config import cfg from oslo.config import cfg
import unittest import unittest
import heat.api # pyflakes_bypass review 23102
from heat.common import context from heat.common import context
from heat.common import policy from heat.common import policy
from heat.common import exception from heat.common import exception

View File

@ -22,7 +22,6 @@ from heat.engine import clients
from heat.common import context from heat.common import context
from heat.common import template_format from heat.common import template_format
from heat.engine import parser from heat.engine import parser
import heat.engine.resources # pyflakes_bypass review 23102
from heat.tests.v1_1 import fakes from heat.tests.v1_1 import fakes
from novaclient.v1_1 import security_groups as nova_sg from novaclient.v1_1 import security_groups as nova_sg

View File

@ -22,7 +22,6 @@ from heat.common import context
from heat.common import exception from heat.common import exception
from heat.common import template_format from heat.common import template_format
from heat.engine import parser from heat.engine import parser
import heat.engine.resources # pyflakes_bypass review 23102
try: try:
from quantumclient.common.exceptions import QuantumClientException from quantumclient.common.exceptions import QuantumClientException

View File

@ -1,15 +0,0 @@
from pyflakes.scripts import pyflakes
from pyflakes.checker import Checker
def report_with_bypass(self, messageClass, *args, **kwargs):
message = messageClass(self.filename, *args, **kwargs)
with open(self.filename, 'r') as code:
if 'pyflakes_bypass' in code.readlines()[message.lineno - 1]:
return
self.messages.append(message)
# monkey patch checker to support bypass
Checker.report = report_with_bypass
pyflakes.main()

View File

@ -16,5 +16,4 @@ ${PEP8} ${EXCLUDE} .
# Check binaries without py extension # Check binaries without py extension
${PEP8} bin/heat-api bin/heat-api-cfn bin/heat-api-cloudwatch bin/heat-cfn bin/heat-engine bin/heat-watch ${PEP8} bin/heat-api bin/heat-api-cfn bin/heat-api-cloudwatch bin/heat-cfn bin/heat-engine bin/heat-watch
! python tools/pyflakes-bypass.py heat/ | grep "imported but unused\|redefinition of function" ! pyflakes heat/ | grep "imported but unused\|redefinition of function"