Disable TRY003

This commit is contained in:
Bruno Alla 2025-02-18 22:28:53 +00:00
parent e8baa546a5
commit 9700afdd24
5 changed files with 6 additions and 8 deletions

View File

@ -124,6 +124,7 @@ lint.ignore = [
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
"S101", # Use of assert detected https://docs.astral.sh/ruff/rules/assert/
"SIM102", # sometimes it's better to nest
"TRY003", # Avoid specifying long messages outside the exception class
# Checks for uses of isinstance/issubclass that take a tuple of types for comparison.
# Deactivated because it can make the code slow: https://github.com/astral-sh/ruff/issues/7871
"UP038",

View File

@ -301,8 +301,7 @@ def main(django_max_version=None) -> None:
if __name__ == "__main__":
if GITHUB_REPO is None:
msg = "No github repo, please set the environment variable GITHUB_REPOSITORY"
raise RuntimeError(msg)
raise RuntimeError("No github repo, please set the environment variable GITHUB_REPOSITORY")
max_version = None
last_arg = sys.argv[-1]
if CURRENT_FILE.name not in last_arg:

View File

@ -30,7 +30,7 @@ def get_version_from_dockerfile() -> str:
_, _, docker_tag = line.partition(":")
version_str, _, _ = docker_tag.partition("-")
return version_str
raise RuntimeError("Could not find version in Dockerfile") # noqa: TRY003
raise RuntimeError("Could not find version in Dockerfile")
def get_version_from_package_json() -> str:

View File

@ -33,7 +33,7 @@ def get_pyproject_toml_version():
for dependency in data["project"]["dependencies"]:
if dependency.startswith("ruff=="):
return dependency.split("==")[1]
raise RuntimeError("Could not find version in pyproject.toml") # noqa: TRY003
raise RuntimeError("Could not find version in pyproject.toml")
def update_ruff_version(old_version, new_version):

View File

@ -162,9 +162,7 @@ def update_git_repo(paths: list[Path], release: str) -> None:
if __name__ == "__main__":
if GITHUB_REPO is None:
msg = "No github repo, please set the environment variable GITHUB_REPOSITORY"
raise RuntimeError(msg)
raise RuntimeError("No github repo, please set the environment variable GITHUB_REPOSITORY")
if GIT_BRANCH is None:
msg = "No git branch set, please set the GITHUB_REF_NAME environment variable"
raise RuntimeError(msg)
raise RuntimeError("No git branch set, please set the GITHUB_REF_NAME environment variable")
main()