Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion isic/core/api/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class Meta:
)
@paginate(CursorPagination)
def collection_list(
request, pinned: bool | None = None, sort: Literal["name", "created"] | None = None
request, *, pinned: bool | None = None, sort: Literal["name", "created"] | None = None
) -> list[CollectionOut]:
queryset = get_visible_objects(request.user, "core.view_collection", Collection.objects.all())

Expand Down
2 changes: 1 addition & 1 deletion isic/core/management/commands/anonymize_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ def _clear_sensitive_tables(*, dry_run):
default=1000,
help="Number of records to process in each batch",
)
def anonymize_database(dry_run: bool, batch_size: int):
def anonymize_database(dry_run: bool, batch_size: int): # noqa: FBT001
salt = secrets.token_hex(32)
faker = Faker()
faker.seed_instance(int(hashlib.sha256(salt.encode()).hexdigest()[:8], 16))
Expand Down
2 changes: 1 addition & 1 deletion isic/core/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
def add_or_remove_groups(
sender: type[User],
instance: User,
created: bool,
created: bool, # noqa: FBT001
**kwargs,
):
from django.contrib.auth.models import Group
Expand Down
4 changes: 2 additions & 2 deletions isic/core/pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def next_link( # noqa: PLR0913
page: list,
cursor: Cursor,
order: tuple,
has_previous: bool,
has_previous: bool, # noqa: FBT001
limit: int,
next_position: str,
previous_position: str,
Expand Down Expand Up @@ -288,7 +288,7 @@ def previous_link( # noqa: PLR0913
page: list,
cursor: Cursor,
order: tuple,
has_next: bool,
has_next: bool, # noqa: FBT001
limit: int,
next_position: str,
previous_position: str,
Expand Down
6 changes: 3 additions & 3 deletions isic/ingest/tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Meta:
creator = factory.SubFactory(UserFactory)

@factory.post_generation
def owners(self, create: bool, extracted: Any, **kwargs: Any) -> None:
def owners(self, create: bool, extracted: Any, **kwargs: Any) -> None: # noqa: FBT001
if not create:
return
if extracted is None:
Expand Down Expand Up @@ -163,7 +163,7 @@ class Params:
# https://github.com/pytest-dev/pytest-factoryboy/issues/67

@factory.post_generation
def short_diagnosis(self, create: bool, extracted: Any, **kwargs: Any) -> None:
def short_diagnosis(self, create: bool, extracted: Any, **kwargs: Any) -> None: # noqa: FBT001
if extracted is None:
# Normal flow, no short_diagnosis provided.
return
Expand All @@ -184,7 +184,7 @@ def short_diagnosis(self, create: bool, extracted: Any, **kwargs: Any) -> None:
self.save()

@factory.post_generation
def short_anatom_site(self, create: bool, extracted: Any, **kwargs: Any) -> None:
def short_anatom_site(self, create: bool, extracted: Any, **kwargs: Any) -> None: # noqa: FBT001
if extracted is None:
return

Expand Down
2 changes: 1 addition & 1 deletion isic/login/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __str__(self) -> str:
def create_or_save_user_profile(
sender: type[User],
instance: User,
created: bool,
created: bool, # noqa: FBT001
**kwargs,
):
if created:
Expand Down
4 changes: 2 additions & 2 deletions isic/studies/tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class Meta:
public = factory.Faker("boolean")

@factory.post_generation
def owners(self, create: bool, extracted: Any, **kwargs: Any) -> None:
def owners(self, create: bool, extracted: Any, **kwargs: Any) -> None: # noqa: FBT001
if not create:
return
if extracted is None:
Expand All @@ -78,7 +78,7 @@ def owners(self, create: bool, extracted: Any, **kwargs: Any) -> None:
self.owners.add(*extracted)

@factory.post_generation
def features(self, create: bool, extracted: Any, **kwargs: Any) -> None:
def features(self, create: bool, extracted: Any, **kwargs: Any) -> None: # noqa: FBT001
if not create:
return
if extracted:
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ ignore = [
# Project-specific
"A002", # builtin-argument-shadowing
"DJ001", # django-nullable-model-string-field
"FBT001", # boolean-typed-positional-argument
"I002", # missing-required-import
"PLC0415", # import-outside-top-level
"RET503", # implicit-return
Expand Down