mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-04-10 11:54:15 +03:00
Disable TRY003
This commit is contained in:
parent
e8baa546a5
commit
9700afdd24
|
@ -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",
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue
Block a user