Skip to content

Commit

Permalink
🚨 # noqa: ANN101 Validator classes
Browse files Browse the repository at this point in the history
Signed-off-by: rjdbcm <[email protected]>
  • Loading branch information
rjdbcm committed Jun 21, 2024
1 parent 896af32 commit 7b7dff0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ozi/new/interactive.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
``ozi-new`` interactive prompts
"""

from __future__ import annotations

import re
Expand All @@ -22,13 +23,11 @@
from ozi.trove import from_prefix

if TYPE_CHECKING:
from typing import Self

from prompt_toolkit.document import Document


class ProjectNameValidator(Validator):
def validate(self: Self, document: Document) -> None: # pragma: no cover
def validate(self, document: Document) -> None: # pragma: no cover # noqa: ANN101
if not re.match(
r'\A([A-Z0-9]|[A-Z0-9][A-Z0-9._-]*[A-Z0-9])\Z',
document.text,
Expand All @@ -38,7 +37,7 @@ def validate(self: Self, document: Document) -> None: # pragma: no cover


class PackageValidator(Validator):
def validate(self: Self, document: Document) -> None: # pragma: no cover
def validate(self, document: Document) -> None: # pragma: no cover # noqa: ANN101
if len(document.text) == 0:
raise ValidationError(0, 'cannot be empty')
response = requests.get(
Expand Down

0 comments on commit 7b7dff0

Please sign in to comment.