Fix and enable gating on H306

H306, module imports should be in alphabetical order
This hacking check actually improves readability quite
a bit, as module imports can be sorted in groups (python stdlibs,
external imports, in-module imports)

Change-Id: I11dc9155fbfc84389f2a5956f393f705388f83ba
This commit is contained in:
Dirk Mueller 2013-12-16 15:41:51 +01:00
parent efae202e0a
commit 109ea08546
15 changed files with 31 additions and 6 deletions

View File

@ -13,8 +13,9 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from urlparse import urlparse
from requests.auth import AuthBase from requests.auth import AuthBase
from urlparse import urlparse
from keystoneclient.v2_0.client import Client from keystoneclient.v2_0.client import Client

View File

@ -13,7 +13,9 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import logging import logging
from designateclient.cli import base from designateclient.cli import base
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -13,7 +13,9 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import logging import logging
from designateclient.cli import base from designateclient.cli import base
from designateclient.v1.domains import Domain from designateclient.v1.domains import Domain

View File

@ -13,7 +13,9 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import logging import logging
from designateclient.cli import base from designateclient.cli import base
from designateclient.v1.records import Record from designateclient.v1.records import Record

View File

@ -13,7 +13,9 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import logging import logging
from designateclient.cli import base from designateclient.cli import base
from designateclient.v1.servers import Server from designateclient.v1.servers import Server

View File

@ -14,6 +14,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import logging import logging
from designateclient.cli import base from designateclient.cli import base
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -13,7 +13,9 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import logging import logging
from designateclient.cli import base from designateclient.cli import base
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -13,8 +13,10 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import logging import logging
import os import os
from cliff.app import App from cliff.app import App
from cliff.commandmanager import CommandManager from cliff.commandmanager import CommandManager
from designateclient.version import version_info as version from designateclient.version import version_info as version

View File

@ -13,9 +13,12 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import os import os
import pkg_resources import pkg_resources
import json import json
from designateclient import exceptions from designateclient import exceptions

View File

@ -15,8 +15,9 @@
# under the License. # under the License.
import requests import requests
from stevedore import extension from stevedore import extension
from designateclient import exceptions
from designateclient.auth import KeystoneAuth from designateclient.auth import KeystoneAuth
from designateclient import exceptions
class Client(object): class Client(object):

View File

@ -14,9 +14,10 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import json import json
from designateclient import warlock
from designateclient import utils from designateclient import utils
from designateclient.v1.base import CrudController from designateclient.v1.base import CrudController
from designateclient import warlock
Domain = warlock.model_factory(utils.load_schema('v1', 'domain')) Domain = warlock.model_factory(utils.load_schema('v1', 'domain'))

View File

@ -13,11 +13,13 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import json import json
from designateclient import warlock
from designateclient import utils from designateclient import utils
from designateclient.v1.base import CrudController from designateclient.v1.base import CrudController
from designateclient.v1.domains import Domain from designateclient.v1.domains import Domain
from designateclient import warlock
Record = warlock.model_factory(utils.load_schema('v1', 'record')) Record = warlock.model_factory(utils.load_schema('v1', 'record'))

View File

@ -13,10 +13,12 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import json import json
from designateclient import warlock
from designateclient import utils from designateclient import utils
from designateclient.v1.base import CrudController from designateclient.v1.base import CrudController
from designateclient import warlock
Server = warlock.model_factory(utils.load_schema('v1', 'server')) Server = warlock.model_factory(utils.load_schema('v1', 'server'))

View File

@ -15,8 +15,10 @@
# Code copied from Warlock, as warlock depends on jsonschema==0.2 # Code copied from Warlock, as warlock depends on jsonschema==0.2
# Hopefully we can upstream the changes ASAP. # Hopefully we can upstream the changes ASAP.
# #
import copy import copy
import logging import logging
import jsonschema import jsonschema
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -33,6 +33,6 @@ commands = python setup.py testr --coverage --testr-args='{posargs}'
commands = {posargs} commands = {posargs}
[flake8] [flake8]
ignore = H302,H306,H401,H402,H404 ignore = H302,H401,H402,H404
builtins = _ builtins = _
exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools