From c75d7ef4cc33b0b50fec7a65f9808cf2c24571b9 Mon Sep 17 00:00:00 2001 From: Jonathan Willitts Date: Fri, 2 Feb 2024 23:10:25 +0000 Subject: [PATCH] Bump pre-commit repos, run through Black 24.1.1 Black changes witnessed (mainly) include: - addition of blank line between module docstrings and imports - removal of blank lines between class declarations and docstrings - prefer splitting assignment statements on right-hand side - wrap conditional expressions that span multiple lines in parens - put `...` in stubs on same line - add E701 and E704 to flake8 ignore list, see: - https://github.com/psf/black/blob/main/docs/guides/using_black_with_other_tools.md#e701--e704 - https://github.com/psf/black/issues/3887 (E704) - https://github.com/psf/black/issues/4173 (E701) --- .pre-commit-config.yaml | 12 ++++++------ edc_action_item/action_with_notification.py | 1 - edc_action_item/forms/action_item_crf_form_mixin.py | 1 - edc_action_item/forms/action_item_form_mixin.py | 2 -- edc_action_item/models/action_item.py | 3 +-- edc_action_item/models/reference.py | 1 - edc_action_item/stubs.py | 9 +++------ .../view_utils/action_item_popover_list_item.py | 3 +-- edc_action_item/visit_schedule_mixin.py | 1 - setup.cfg | 2 +- 10 files changed, 12 insertions(+), 23 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6f3af91..3fa7253 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,32 +3,32 @@ exclude: tests/etc/user-* repos: - repo: https://github.com/PyCQA/bandit - rev: 1.7.5 + rev: 1.7.7 hooks: - id: bandit args: - "-x *test*.py" - repo: https://github.com/psf/black - rev: 23.9.1 + rev: 24.1.1 hooks: - id: black language_version: python3.11 - repo: https://github.com/pycqa/flake8 - rev: 6.1.0 + rev: 7.0.0 hooks: - id: flake8 args: - "--config=setup.cfg" - repo: https://github.com/PyCQA/isort - rev: 5.12.0 + rev: 5.13.2 hooks: - id: isort - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: requirements-txt-fixer files: requirements/.*\.txt$ @@ -42,7 +42,7 @@ repos: - id: detect-private-key - repo: https://github.com/adrienverge/yamllint - rev: v1.32.0 + rev: v1.33.0 hooks: - id: yamllint args: diff --git a/edc_action_item/action_with_notification.py b/edc_action_item/action_with_notification.py index 3a214d8..54c305b 100644 --- a/edc_action_item/action_with_notification.py +++ b/edc_action_item/action_with_notification.py @@ -7,7 +7,6 @@ class ActionWithNotification(Action): - """A class mixin for the Action class that adds support for notifications. """ diff --git a/edc_action_item/forms/action_item_crf_form_mixin.py b/edc_action_item/forms/action_item_crf_form_mixin.py index a26432e..73a2b30 100644 --- a/edc_action_item/forms/action_item_crf_form_mixin.py +++ b/edc_action_item/forms/action_item_crf_form_mixin.py @@ -2,7 +2,6 @@ class ActionItemCrfFormMixin: - """Declare with forms.ModelForm.""" class Meta: diff --git a/edc_action_item/forms/action_item_form_mixin.py b/edc_action_item/forms/action_item_form_mixin.py index 6b4cb6b..217547c 100644 --- a/edc_action_item/forms/action_item_form_mixin.py +++ b/edc_action_item/forms/action_item_form_mixin.py @@ -2,7 +2,6 @@ class ActionItemFormMixin: - """Declare with forms.ModelForm.""" class Meta: @@ -14,7 +13,6 @@ class Meta: class ActionItemCrfFormMixin: - """Declare with forms.ModelForm.""" class Meta: diff --git a/edc_action_item/models/action_item.py b/edc_action_item/models/action_item.py index db378ce..fd4a15b 100644 --- a/edc_action_item/models/action_item.py +++ b/edc_action_item/models/action_item.py @@ -30,8 +30,7 @@ class PrnModel(BaseUuidModel): subject_identifier: str ... - class CrfModel(CrfModelMixin): - ... + class CrfModel(CrfModelMixin): ... class CurrentSiteManager(BaseCurrentSiteManager): diff --git a/edc_action_item/models/reference.py b/edc_action_item/models/reference.py index f31ada0..ba80cbd 100644 --- a/edc_action_item/models/reference.py +++ b/edc_action_item/models/reference.py @@ -14,7 +14,6 @@ def get_by_natural_key(self, action_identifier): class Reference(NonUniqueSubjectIdentifierFieldMixin, ActionModelMixin, BaseUuidModel): - """Model used as a default reference model for simple actions not created by another model. diff --git a/edc_action_item/stubs.py b/edc_action_item/stubs.py index 3184f68..2f27cd7 100644 --- a/edc_action_item/stubs.py +++ b/edc_action_item/stubs.py @@ -15,8 +15,7 @@ def __init__( related_action_item: Optional["ActionItemStub"] = None, using: Optional[str] = None, readonly: Optional[bool] = None, - ) -> None: - ... + ) -> None: ... name: str action_item: "ActionItemStub" @@ -52,11 +51,9 @@ class ActionItemStub(Protocol): action_cls: ActionStub - def get_status_display(self) -> str: - ... + def get_status_display(self) -> str: ... - def get_action_cls(self) -> Type[ActionStub]: - ... + def get_action_cls(self) -> Type[ActionStub]: ... class ActionItemWithNotificationStub(ActionItemStub, Protocol): diff --git a/edc_action_item/view_utils/action_item_popover_list_item.py b/edc_action_item/view_utils/action_item_popover_list_item.py index 6e737b3..5803790 100644 --- a/edc_action_item/view_utils/action_item_popover_list_item.py +++ b/edc_action_item/view_utils/action_item_popover_list_item.py @@ -19,8 +19,7 @@ class PrnModel(BaseUuidModel): subject_identifier: str ... - class CrfModel(CrfModelMixin): - ... + class CrfModel(CrfModelMixin): ... @dataclass diff --git a/edc_action_item/visit_schedule_mixin.py b/edc_action_item/visit_schedule_mixin.py index fb63467..5c222b7 100644 --- a/edc_action_item/visit_schedule_mixin.py +++ b/edc_action_item/visit_schedule_mixin.py @@ -3,7 +3,6 @@ class VisitScheduleActionMixin: - """A mixin for the Action class to add properties and methods related to the visit schedule from edc_visit_schedule. diff --git a/setup.cfg b/setup.cfg index faf0a48..f636e24 100644 --- a/setup.cfg +++ b/setup.cfg @@ -35,7 +35,7 @@ exclude = edc_action_item.tests* [flake8] -ignore = E226,W503,E203 +ignore = E226,W503,E203,E701,E704 max-line-length = 95 max-complexity = 10 exclude = */migrations/*,.tox,.git,__pycache__,build,dist,.eggs