Linting (but real)

This commit is contained in:
zandercymatics 2024-01-18 09:07:28 -07:00
parent 860e445ea8
commit 4054bef461
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
2 changed files with 6 additions and 8 deletions

View file

@ -22,6 +22,10 @@ class Command(BaseCommand):
# and, in all cases, make sure to use a list (not a string) for flags/args
# as this will quote the output.
linters = {
"mypy": {
"purpose": "Type checking",
"args": ["mypy", "."],
},
"flake8": {
"purpose": "Linting",
"args": ["flake8", ".", "--count", "--show-source", "--statistics"],
@ -30,10 +34,6 @@ class Command(BaseCommand):
"purpose": "Formatting",
"args": ["black", "--check", "."],
},
"mypy": {
"purpose": "Type checking",
"args": ["mypy", "."],
},
"bandit": {
"purpose": "Security scanning",
"args": ["bandit", "-r", "."],

View file

@ -27,13 +27,11 @@ class DomainHelper:
return bool(cls.DOMAIN_REGEX.match(domain))
@classmethod
def validate(cls, domain: str | None, blank_ok=False) -> str:
def validate(cls, domain: str, blank_ok=False) -> str:
"""Attempt to determine if a domain name could be requested."""
# Split into pieces for the linter
cleaned_domain = cls._validate_domain_string(domain, blank_ok)
if cleaned_domain is not None:
domain = cleaned_domain
domain = cls._validate_domain_string(domain, blank_ok)
try:
if not check_domain_available(domain):