mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-03 08:22:18 +02:00
Linting (but real)
This commit is contained in:
parent
860e445ea8
commit
4054bef461
2 changed files with 6 additions and 8 deletions
|
@ -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", "."],
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue