Skip to content

Commit

Permalink
🚨 hide some noqa from ruff
Browse files Browse the repository at this point in the history
Signed-off-by: rjdbcm <[email protected]>
  • Loading branch information
rjdbcm committed Jul 8, 2024
1 parent 51e4228 commit 15f07a1
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions ozi/new/interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

class Project: # pragma: no cover
def __init__(
self, # noqa: ANN101
self, # noqa: ANN101,RUF100
allow_file: list[str] | None = None,
ci_provider: str | None = None,
copyright_head: str | None = None,
Expand Down Expand Up @@ -583,7 +583,10 @@ def pypi_package_exists(package: str) -> bool: # pragma: no cover


class ProjectNameValidator(Validator):
def validate(self, document: Document) -> None: # pragma: no cover # noqa: ANN101
def validate(
self, # noqa: ANN101,RUF100
document: Document,
) -> None: # pragma: no cover
if len(document.text) == 0:
raise ValidationError(0, 'cannot be empty')
if not re.match(
Expand All @@ -595,22 +598,31 @@ def validate(self, document: Document) -> None: # pragma: no cover # noqa: ANN


class NotReservedValidator(ThreadedValidator):
def validate(self, document: Document) -> None: # pragma: no cover # noqa: ANN101
def validate(
self, # noqa: ANN101,RUF100
document: Document,
) -> None: # pragma: no cover
self.validator.validate(document)
if pypi_package_exists(document.text):
raise ValidationError(len(document.text), 'project with that name exists')


class LengthValidator(Validator):
def validate(self, document: Document) -> None: # pragma: no cover # noqa: ANN101
def validate(
self, # noqa: ANN101,RUF100
document: Document,
) -> None: # pragma: no cover
if len(document.text) == 0:
raise ValidationError(0, 'must not be empty')
if len(document.text) > 512:
raise ValidationError(512, 'input is too long')


class PackageValidator(Validator):
def validate(self, document: Document) -> None: # pragma: no cover # noqa: ANN101
def validate(
self, # noqa: ANN101,RUF100
document: Document,
) -> None: # pragma: no cover
if len(document.text) == 0:
raise ValidationError(0, 'cannot be empty')
if pypi_package_exists(document.text):
Expand Down Expand Up @@ -653,7 +665,7 @@ class Admonition(RadioList[_T]):
multiple_selection = False

def __init__( # noqa: C901
self, # noqa: ANN101
self, # noqa: ANN101,RUF100
values: Sequence[tuple[_T, Any]],
default: _T | None = None,
) -> None: # pragma: no cover
Expand Down Expand Up @@ -712,7 +724,7 @@ def _click(event: KeyPressEvent) -> None:
always_hide_cursor=True,
)

def _handle_enter(self) -> None: # noqa: ANN101
def _handle_enter(self) -> None: # noqa: ANN101,RUF100
pass # pragma: no cover


Expand Down

0 comments on commit 15f07a1

Please sign in to comment.