blob: 6a86818d213dd90ce354d678309881a0287b4fe2 [file] [log] [blame]
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
[tox]
envlist = py27,py36,py37,py38,py39
skipsdist = True
minversion = ${TOX_VERSION}
skip_missing_interpreters = True
skip_install = True
[testenv]
commands = flake8 --count --show-source \
${CMAKE_SOURCE_DIR}/python \
${CMAKE_SOURCE_DIR}/console \
${CMAKE_SOURCE_DIR}/docs \
${CMAKE_SOURCE_DIR}/tests \
${CMAKE_SOURCE_DIR}/tools \
${CMAKE_SOURCE_DIR}/tools/qdstat \
${CMAKE_SOURCE_DIR}/tools/qdmanage
deps = hacking>=1.1.0
[testenv:py27]
basepython = python2.7
[testenv:py36]
basepython = python3.6
[testenv:py37]
basepython = python3.7
[testenv:py38]
basepython = python3.8
[testenv:py39]
basepython = python3.9
[flake8]
# TODO(DISPATCH-1974) decrease the limit
max-line-length = 464
# TODO(DISPATCH-1974) re-enable all these warnings
ignore =
# H238: old style class declaration, use new style (inherit from `object`)
H238,
# E704 multiple statements on one line (def)
E704,
# E241 multiple spaces after ','
E241,
# E203 whitespace before ':'
E203,
# H101: Use TODO(NAME)
H101,
# H202: assertRaises Exception too broad
H202,
# H234: assertEquals is deprecated, use assertEqual
H234,
# H401: docstring should not start with a space
H401,
# H403: multi line docstrings should end on a new line
H403,
# H404: multi line docstring should start without a leading new line
H404,
# H405: multi line docstring summary not separated with an empty line
H405,
# E265 block comment should start with '# '
E265,
# E266 too many leading '#' for block comment
E266,
# E221 multiple spaces before operator
E221,
# E222 multiple spaces after operator
E222,
# do not use bare 'except'
E722,
# H201: no 'except:' at least use 'except Exception:'
H201,
# H104: File contains nothing but comments
H104,
# H301: one import per line
H301,
# H306: imports not in alphabetical order
H306,
# imported but unused
F401,
# 'from proton import *' used; unable to detect undefined names
F403,
# F811 redefinition of unused 'Timeout' from line 29
F811,
# E712 comparison to True should be 'if cond is not True:' or 'if not cond:'
# E712 comparison to False should be 'if cond is False:' or 'if not cond:'
E712,
# E402 module level import not at top of file
E402,
# may be undefined, or defined from star imports: datetime
F405,
# ambiguous variable name 'l'
E741,
# local variable 'int_nodes' is assigned to but never used
F841,
# TODO(DISPATCH-1974) decide which of these two warnings we want disabled
# _transport.py:908:21: W503 line break before binary operator
# _transport.py:907:56: W504 line break after binary operator
W503,
W504,
exclude =
# TODO(DISPATCH-1974) generated by gRPC tooling
friendship_pb2.py,
friendship_pb2_grpc.py,