From 778169b157b2ce2e6907035f77bdbb8627682493 Mon Sep 17 00:00:00 2001 From: Jonathan Willitts Date: Fri, 2 Feb 2024 23:23:17 +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 ++++++------ .../model_mixins/subject_on_schedule_model_mixin.py | 1 - .../visit_schedule/visit_schedule_model_mixins.py | 1 - edc_visit_schedule/models/offschedule.py | 1 - edc_visit_schedule/models/onschedule.py | 1 - edc_visit_schedule/tests/dummy_panel.py | 1 - edc_visit_schedule/typing_stubs.py | 12 ++++-------- edc_visit_schedule/view_mixins.py | 3 +-- setup.cfg | 2 +- 9 files changed, 12 insertions(+), 22 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 718de57..1465118 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.3.0 + rev: 24.1.1 hooks: - id: black language_version: python3.10 - repo: https://github.com/pycqa/flake8 - rev: 6.0.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.31.0 + rev: v1.33.0 hooks: - id: yamllint args: diff --git a/edc_visit_schedule/model_mixins/subject_on_schedule_model_mixin.py b/edc_visit_schedule/model_mixins/subject_on_schedule_model_mixin.py index 79a318e..9ac9e33 100644 --- a/edc_visit_schedule/model_mixins/subject_on_schedule_model_mixin.py +++ b/edc_visit_schedule/model_mixins/subject_on_schedule_model_mixin.py @@ -2,7 +2,6 @@ class SubjectOnScheduleModelMixin(models.Model): - """A model mixin for a consent or other model that when saved updates a subject to be `on schedule`. diff --git a/edc_visit_schedule/model_mixins/visit_schedule/visit_schedule_model_mixins.py b/edc_visit_schedule/model_mixins/visit_schedule/visit_schedule_model_mixins.py index fb78e9c..74acff9 100644 --- a/edc_visit_schedule/model_mixins/visit_schedule/visit_schedule_model_mixins.py +++ b/edc_visit_schedule/model_mixins/visit_schedule/visit_schedule_model_mixins.py @@ -11,7 +11,6 @@ class VisitScheduleModelMixin( VisitScheduleMethodsModelMixin, models.Model, ): - """A model mixin for Appointment and related (subject) visit models. A model mixin that adds field attributes and methods that diff --git a/edc_visit_schedule/models/offschedule.py b/edc_visit_schedule/models/offschedule.py index 0721f6f..910bd02 100644 --- a/edc_visit_schedule/models/offschedule.py +++ b/edc_visit_schedule/models/offschedule.py @@ -5,7 +5,6 @@ class OffSchedule(SiteModelMixin, OffScheduleModelMixin, BaseUuidModel): - """A model used by the system. Records a subject as no longer on a schedule. """ diff --git a/edc_visit_schedule/models/onschedule.py b/edc_visit_schedule/models/onschedule.py index d9c2322..6425e20 100644 --- a/edc_visit_schedule/models/onschedule.py +++ b/edc_visit_schedule/models/onschedule.py @@ -5,7 +5,6 @@ class OnSchedule(SiteModelMixin, OnScheduleModelMixin, BaseUuidModel): - """A model used by the system. Auto-completed by subject_consent.""" class Meta(OnScheduleModelMixin.Meta, BaseUuidModel.Meta): diff --git a/edc_visit_schedule/tests/dummy_panel.py b/edc_visit_schedule/tests/dummy_panel.py index 5bf9487..1440265 100644 --- a/edc_visit_schedule/tests/dummy_panel.py +++ b/edc_visit_schedule/tests/dummy_panel.py @@ -1,5 +1,4 @@ class DummyPanel: - """A dummy lab panel object.""" def __init__(self, name=None, verbose_name=None, requisition_model=None): diff --git a/edc_visit_schedule/typing_stubs.py b/edc_visit_schedule/typing_stubs.py index 83669a5..35491e0 100644 --- a/edc_visit_schedule/typing_stubs.py +++ b/edc_visit_schedule/typing_stubs.py @@ -2,14 +2,10 @@ class VisitScheduleFieldsProtocol(Protocol): - def visit_code(self) -> str: - ... + def visit_code(self) -> str: ... - def visit_code_sequence(self) -> int: - ... + def visit_code_sequence(self) -> int: ... - def visit_schedule_name(self) -> str: - ... + def visit_schedule_name(self) -> str: ... - def schedule_name(self) -> str: - ... + def schedule_name(self) -> str: ... diff --git a/edc_visit_schedule/view_mixins.py b/edc_visit_schedule/view_mixins.py index f823692..b296b93 100644 --- a/edc_visit_schedule/view_mixins.py +++ b/edc_visit_schedule/view_mixins.py @@ -12,8 +12,7 @@ from .schedule import Schedule from .visit_schedule import VisitSchedule - class OnScheduleLikeModel(OnScheduleModelMixin): - ... + class OnScheduleLikeModel(OnScheduleModelMixin): ... class VisitScheduleViewMixin: diff --git a/setup.cfg b/setup.cfg index 400328b..1d58151 100644 --- a/setup.cfg +++ b/setup.cfg @@ -35,7 +35,7 @@ exclude = edc_visit_schedule.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,_version.py