Merge "Run mypy from tox"
This commit is contained in:
@@ -12,30 +12,14 @@ repos:
|
||||
- id: debug-statements
|
||||
- id: check-yaml
|
||||
files: .*\.(yaml|yml)$
|
||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||
rev: v0.14.8
|
||||
hooks:
|
||||
- id: ruff-check
|
||||
args: ['--fix', '--unsafe-fixes']
|
||||
- id: ruff-format
|
||||
- repo: https://opendev.org/openstack/hacking
|
||||
rev: 8.0.0
|
||||
hooks:
|
||||
- id: hacking
|
||||
additional_dependencies: []
|
||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||
rev: v0.14.5
|
||||
hooks:
|
||||
- id: ruff-check
|
||||
args: ['--fix', '--unsafe-fixes']
|
||||
- id: ruff-format
|
||||
- repo: https://github.com/pre-commit/mirrors-mypy
|
||||
rev: v1.18.2
|
||||
hooks:
|
||||
- id: mypy
|
||||
additional_dependencies: [
|
||||
'fixtures',
|
||||
'keystoneauth',
|
||||
'oslo.i18n',
|
||||
'openstacksdk',
|
||||
]
|
||||
# keep this in-sync with '[tool.mypy] exclude' in 'pyproject.toml'
|
||||
exclude: |
|
||||
(?x)(
|
||||
doc/.*
|
||||
| releasenotes/.*
|
||||
)
|
||||
|
||||
@@ -44,15 +44,9 @@ packages = [
|
||||
python_version = "3.10"
|
||||
show_column_numbers = true
|
||||
show_error_context = true
|
||||
ignore_missing_imports = true
|
||||
strict = true
|
||||
# keep this in-sync with 'mypy.exclude' in '.pre-commit-config.yaml'
|
||||
exclude = '''
|
||||
(?x)(
|
||||
doc
|
||||
| releasenotes
|
||||
)
|
||||
'''
|
||||
ignore_missing_imports = true
|
||||
exclude = '(?x)(doc | releasenotes)'
|
||||
|
||||
[[tool.mypy.overrides]]
|
||||
module = ["oslo_limit.tests.*"]
|
||||
|
||||
14
tox.ini
14
tox.ini
@@ -12,11 +12,23 @@ commands =
|
||||
stestr slowest
|
||||
|
||||
[testenv:pep8]
|
||||
skip_install = true
|
||||
description =
|
||||
Run style checks.
|
||||
deps =
|
||||
pre-commit>=2.6.0 # MIT
|
||||
{[testenv:mypy]deps}
|
||||
commands =
|
||||
pre-commit run -a
|
||||
{[testenv:mypy]commands}
|
||||
|
||||
[testenv:mypy]
|
||||
description =
|
||||
Run type checks.
|
||||
deps =
|
||||
{[testenv]deps}
|
||||
mypy
|
||||
commands =
|
||||
mypy --cache-dir="{envdir}/mypy_cache" {posargs:oslo_limit}
|
||||
|
||||
[testenv:venv]
|
||||
commands = {posargs}
|
||||
|
||||
Reference in New Issue
Block a user