Update pre-commit hooks
Change-Id: I93d5520bc67135db9b0ac9da40dbfb587cb9acad Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
This commit is contained in:
@@ -4,7 +4,7 @@ default_language_version:
|
|||||||
python: python3
|
python: python3
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v4.6.0
|
rev: v5.0.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
- id: mixed-line-ending
|
- id: mixed-line-ending
|
||||||
@@ -18,11 +18,11 @@ repos:
|
|||||||
files: .*\.(yaml|yml)$
|
files: .*\.(yaml|yml)$
|
||||||
exclude: '^zuul.d/.*$'
|
exclude: '^zuul.d/.*$'
|
||||||
- repo: https://github.com/PyCQA/doc8
|
- repo: https://github.com/PyCQA/doc8
|
||||||
rev: v1.1.1
|
rev: v1.1.2
|
||||||
hooks:
|
hooks:
|
||||||
- id: doc8
|
- id: doc8
|
||||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||||
rev: v0.6.7
|
rev: v0.11.12
|
||||||
hooks:
|
hooks:
|
||||||
- id: ruff
|
- id: ruff
|
||||||
args: ['--fix', '--unsafe-fixes']
|
args: ['--fix', '--unsafe-fixes']
|
||||||
@@ -34,7 +34,7 @@ repos:
|
|||||||
# args: ['-l', '79']
|
# args: ['-l', '79']
|
||||||
# exclude: '^codegenerator/templates/.*$'
|
# exclude: '^codegenerator/templates/.*$'
|
||||||
- repo: https://github.com/pre-commit/mirrors-mypy
|
- repo: https://github.com/pre-commit/mirrors-mypy
|
||||||
rev: v1.11.2
|
rev: v1.16.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: mypy
|
- id: mypy
|
||||||
language: python
|
language: python
|
||||||
|
@@ -220,7 +220,7 @@ def main():
|
|||||||
metadata_path = Path(args.metadata)
|
metadata_path = Path(args.metadata)
|
||||||
generator.load_metadata(metadata_path)
|
generator.load_metadata(metadata_path)
|
||||||
# Resulting mod_paths
|
# Resulting mod_paths
|
||||||
res_mods: list[tuple[list[str | None], str, str, str | None]] = []
|
res_mods: list[tuple[list[str], str, str, str | None]] = []
|
||||||
|
|
||||||
for res, res_data in generator.metadata.resources.items():
|
for res, res_data in generator.metadata.resources.items():
|
||||||
if args.service and not res.startswith(args.service):
|
if args.service and not res.startswith(args.service):
|
||||||
@@ -235,7 +235,7 @@ def main():
|
|||||||
else args.target
|
else args.target
|
||||||
)
|
)
|
||||||
if metadata_target in op_data.targets:
|
if metadata_target in op_data.targets:
|
||||||
op_args = op_data.targets[metadata_target]
|
op_args = op_data.targets[metadata_target] # type: ignore
|
||||||
if not op_args.service_type:
|
if not op_args.service_type:
|
||||||
op_args.service_type = res.split(".")[0]
|
op_args.service_type = res.split(".")[0]
|
||||||
if not op_args.api_version:
|
if not op_args.api_version:
|
||||||
@@ -271,9 +271,13 @@ def main():
|
|||||||
res_mods.append(
|
res_mods.append(
|
||||||
(
|
(
|
||||||
[
|
[
|
||||||
res_x[0].replace("-", "_"),
|
x
|
||||||
res_data.api_version,
|
for x in [
|
||||||
res_x[1],
|
res_x[0].replace("-", "_"),
|
||||||
|
res_data.api_version,
|
||||||
|
res_x[1],
|
||||||
|
]
|
||||||
|
if x
|
||||||
],
|
],
|
||||||
mod,
|
mod,
|
||||||
"",
|
"",
|
||||||
|
@@ -31,7 +31,7 @@ OPERATION_TYPE = Literal[
|
|||||||
"find",
|
"find",
|
||||||
]
|
]
|
||||||
|
|
||||||
SUPPORTED_TARGETS = Literal["rust-sdk", "rust-cli", "rust-tui"]
|
SUPPORTED_TARGETS = Literal["rust-sdk", "rust-cli", "rust-tui", "rust-types"]
|
||||||
|
|
||||||
|
|
||||||
class OperationTargetParams(BaseModel):
|
class OperationTargetParams(BaseModel):
|
||||||
|
Reference in New Issue
Block a user