diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8cf3967a7..40534de17 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -43,7 +43,7 @@ repos: - '' - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.4.10 + rev: v0.5.0 hooks: - id: ruff name: Run Ruff linter diff --git a/anta/runner.py b/anta/runner.py index 75391da8d..898296372 100644 --- a/anta/runner.py +++ b/anta/runner.py @@ -50,7 +50,7 @@ def adjust_rlimit_nofile() -> tuple[int, int]: limits = resource.getrlimit(resource.RLIMIT_NOFILE) logger.debug("Initial limit numbers for open file descriptors for the current ANTA process: Soft Limit: %s | Hard Limit: %s", limits[0], limits[1]) - nofile = nofile if limits[1] > nofile else limits[1] + nofile = min(limits[1], nofile) logger.debug("Setting soft limit for open file descriptors for the current ANTA process to %s", nofile) resource.setrlimit(resource.RLIMIT_NOFILE, (nofile, limits[1])) return resource.getrlimit(resource.RLIMIT_NOFILE) diff --git a/asynceapi/config_session.py b/asynceapi/config_session.py index 4054f14bf..558b7fed4 100644 --- a/asynceapi/config_session.py +++ b/asynceapi/config_session.py @@ -278,7 +278,7 @@ async def load_file(self, filename: str, *, replace: bool = False) -> None: commands.append(f"copy {filename} session-config") res: list[dict[str, Any]] = await self._cli(commands=commands) # type: ignore[assignment] # JSON outformat of multiple commands returns list[dict[str, Any]] - checks_re = re.compile(r"error|abort|invalid", flags=re.I) + checks_re = re.compile(r"error|abort|invalid", flags=re.IGNORECASE) messages = res[-1]["messages"] if any(map(checks_re.search, messages)): diff --git a/pyproject.toml b/pyproject.toml index b5fed0df0..71dbdc657 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -71,7 +71,7 @@ dev = [ "pytest-html>=3.2.0", "pytest-metadata>=3.0.0", "pytest>=7.4.0", - "ruff>=0.3.7,<0.5.0", + "ruff>=0.5.0,<0.6.0", "tox>=4.10.0,<5.0.0", "types-PyYAML", "types-pyOpenSSL",