Skip to content

Commit

Permalink
Bump pre-commit checks (#3303)
Browse files Browse the repository at this point in the history
  • Loading branch information
happz authored Oct 18, 2024
1 parent 6e4742b commit abcff92
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repos:
- id: autopep8

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.6.0"
rev: "v5.0.0"
hooks:
- id: check-merge-conflict
- id: check-symlinks
Expand All @@ -21,7 +21,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.11.2"
rev: "v1.12.0"
hooks:
- id: mypy
language_version: "3.9"
Expand Down Expand Up @@ -69,7 +69,7 @@ repos:
args: [--config-file=pyproject.toml]

- repo: https://github.com/RobertCraigie/pyright-python
rev: v1.1.379
rev: v1.1.385
hooks:
- id: pyright
language_version: "3.9"
Expand Down Expand Up @@ -114,7 +114,7 @@ repos:
- "types-lxml"

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: "0.29.2"
rev: "0.29.4"
hooks:
- id: check-metaschema
name: "Check JSON schemas validity"
Expand All @@ -127,7 +127,7 @@ repos:
files: ^tmt/schemas/.*\.yaml

- repo: https://github.com/ansible-community/ansible-lint.git
rev: v24.7.0
rev: v24.9.2
hooks:
- id: ansible-lint
args:
Expand All @@ -143,15 +143,15 @@ repos:
# in order to be parsed by ansible-lint

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.6.4
rev: v0.7.0
hooks:
- id: ruff
args:
- '--fix'
- '--show-fixes'

- repo: https://github.com/teemtee/tmt.git
rev: 1.36.0
rev: 1.37.0
hooks:
- id: tmt-lint
additional_dependencies:
Expand Down
8 changes: 4 additions & 4 deletions tmt/queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ class Task(Generic[TaskResultT]):
def __init__(self, logger: Logger, **kwargs: Any) -> None:
self.logger = logger

self.result = kwargs.get('result', None)
self.guest = kwargs.get('guest', None)
self.exc = kwargs.get('exc', None)
self.requested_exit = kwargs.get('requested_exit', None)
self.result = kwargs.get('result')
self.guest = kwargs.get('guest')
self.exc = kwargs.get('exc')
self.requested_exit = kwargs.get('requested_exit')

@property
def name(self) -> str:
Expand Down
5 changes: 3 additions & 2 deletions tmt/steps/report/junit.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,10 @@ def _read_log_filter(log: Path) -> str:
# Return the prettified XML without checking the XSD
del xml_parser_kwargs['schema']

xml_parser = etree.XMLParser(**xml_parser_kwargs)

try:
tree_root = etree.fromstring( # noqa: S320
xml_data, etree.XMLParser(**xml_parser_kwargs))
tree_root = etree.fromstring(xml_data, xml_parser) # noqa: S320
except etree.XMLSyntaxError as error:
phase.verbose('rendered XML', xml_data, 'red')
raise tmt.utils.ReportError(
Expand Down
4 changes: 2 additions & 2 deletions tmt/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4240,7 +4240,7 @@ def increment(
*args: Any,
**kwargs: Any
) -> urllib3.util.retry.Retry:
error = cast(Optional[Exception], kwargs.get('error', None))
error = cast(Optional[Exception], kwargs.get('error'))

# Detect a subset of exception we do not want to follow with a retry.
# SIM102: Use a single `if` statement instead of nested `if` statements. Keeping for
Expand All @@ -4256,7 +4256,7 @@ def increment(
# a better error message, but don't crash because of a missing attribute or
# something as dumb.

connection_pool = kwargs.get('_pool', None)
connection_pool = kwargs.get('_pool')

if connection_pool is not None and hasattr(connection_pool, 'host'):
message = f"Certificate verify failed for '{connection_pool.host}'."
Expand Down

0 comments on commit abcff92

Please sign in to comment.