[tox] envlist = linters,pep8 minversion = 2.3 skipsdist = True [testenv] install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages} setenv = VIRTUAL_ENV={envdir} OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 OS_TEST_TIMEOUT=60 deps = -r{toxinidir}/test-requirements.txt whitelist_externals = reno [testenv:linters] basepython = python2.7 deps = {[testenv]deps} eventlet httplib2 iso8601 jsonpatch keystonemiddleware kombu MySQL-python oslo.config pecan prettytable psutil sqlalchemy sqlalchemy-migrate wsme pylint whitelist_externals = bash commands = bash -c "find {toxinidir} \ -not \( -type d -name .?\* -prune \) \ -type f \ -not -name \*~ \ -not -name \*.md \ -name \*.sh \ -print0 | xargs -0 bashate -v" bash -c "find {toxinidir} \ \( -name middleware/io-monitor/recipes-common/io-monitor/io-monitor/io_monitor/test-tools/yaml/* -prune \) \ -o \( -name .tox -prune \) \ -o -type f -name '*.yaml' \ -print0 | xargs -0 yamllint" pylint --rcfile=./pylint.rc --extension-pkg-whitelist=greenlet \ ./service-mgmt-api/sm-api/sm_api/ \ ./service-mgmt-tools/sm-tools/sm_tools/ \ ./service-mgmt-client/sm-client/sm_client/ [flake8] # The following are being suppressed for now # E114 indentation is not a multiple of four (comment) # E116 unexpected indentation (comment) # E121 continuation line under-indented for hanging indent # E122 continuation line missing indentation or outdented # E123 closing bracket does not match indentation of opening bracket's line # E124 closing bracket does not match visual indentation # E125 continuation line with same indent as next logical line # E126 continuation line over-indented for hanging indent # E127 continuation line over-indented for visual indent # E128 continuation line under-indented for visual indent # E129 visually indented line with same indent as next logical line # E131 continuation line unaligned for hanging indent # E201 whitespace after '(' # E228 missing whitespace around modulo operator # E231 missing whitespace after ',' # E241 multiple spaces after ':' # E251 unexpected spaces around keyword / parameter equals # E265 block comment should start with '#' # E271 multiple spaces after keyword # E302 expected 2 blank lines, found 1 # E303 too many blank lines # E305 expected 2 blank lines after class or function definition, found 1 # E402 module level import not at top of file # E713 test for membership should be 'not in' # E714 test for object identity should be 'is not' # E722 do not use bare except' # E731 do not assign a lambda expression, use a def # E999 SyntaxError: invalid syntax (this is likely python3) # - hacking codes - # H102: license header not found # H104: File contains nothing but comments # H105: Don't use author tags # H201: no 'except:' # H233: Python 3.x incompatible use of print operator # H236: Python 3.x incompatible __metaclass__, use six.add_metaclass() # H306: imports not in alphabetical order # H401: docstring should not start with a space # H403: multi line docstrings should end on a new line # H404: multi line docstring should start without a leading new line # H405: multi line docstring summary not separated with an empty line # H501: Do not use locals() for string formatting # - errors - # F401 imported but unused # F811 redefinition of unused '' from line # F821 undefined name 'e' # F841 local variable 'foo' is assigned to but never used # - bugbear - # B001 Do not use bare `except:`. Prefer `except Exception:`. If you're sure what you're doing, be explicit and write `except BaseException:`. # B004 Using `hasattr(x, '__call__')` to test if `x` is callable is unreliable. # B006 Do not use mutable data structures for argument defaults. (python3) # B007 Loop control variable 'key' not used within the loop body. If this is intended, start the name with an underscore. # B008 Do not perform calls in argument defaults. The call is performed only once at function definition time. # B303 `__metaclass__` does nothing on Python 3. For Python 2 compatibility, use `six.add_metaclass`. # B305 `.next()` is not a thing on Python 3. Use the `next()` builtin. For Python 2 compatibility, use `six.next()`. # B306 `BaseException.message` has been deprecated as of Python 2.6 and is removed in Python 3. ignore= E114,E116,E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E201,E228,E231,E241,E251,E265,E271, E302,E303,E305,E402,E713,E714,E722,E731,E999, H102,H104,H105,H106,H201,H233,H236,H306,H401,H403,H404,H405,H501, F401,F811,F821,F841, B001,B004,B006,B007,B008,B303,B305,B306 # Enable checks which are off by default # H106 Don’t put vim configuration in source files (off by default). SHOULD BE ENABLED. # H203 Use assertIs(Not)None to check for None (off by default). # H904 Delay string interpolations at logging calls (off by default). SHOULD BE ENABLED. enable-extensions = H203 max-line-length = 110 [testenv:pep8] basepython = python3 usedevelop = False skip_install = True deps = hacking flake8-bugbear flake8 < 3.6.0 commands = flake8 [testenv:venv] basepython = python3 commands = {posargs} [testenv:docs] basepython = python3 deps = -r{toxinidir}/doc/requirements.txt commands = rm -rf doc/build sphinx-build -a -E -W -d doc/build/doctrees -b html doc/source doc/build/html whitelist_externals = rm [testenv:releasenotes] basepython = python3 deps = -r{toxinidir}/doc/requirements.txt commands = rm -rf releasenotes/build sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html whitelist_externals = rm [testenv:newnote] basepython = python3 # Re-use the releasenotes venv envdir = {toxworkdir}/releasenotes deps = -r{toxinidir}/doc/requirements.txt commands = reno new {posargs} [testenv:api-ref] basepython = python3 deps = -r{toxinidir}/doc/requirements.txt commands = rm -rf api-ref/build sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html whitelist_externals = rm