Skip to content

Commit

Permalink
Bump pre-commit repos, run through Black 24.1.1
Browse files Browse the repository at this point in the history
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
  • Loading branch information
JonathanWillitts committed Feb 2, 2024
1 parent 7ea0605 commit 9aab9fd
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 18 deletions.
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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$
Expand All @@ -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:
Expand Down
3 changes: 1 addition & 2 deletions edc_consent/consent_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@

from .model_mixins import ConsentModelMixin

class ConsentLikeModel(NonUniqueSubjectIdentifierModelMixin, ConsentModelMixin):
...
class ConsentLikeModel(NonUniqueSubjectIdentifierModelMixin, ConsentModelMixin): ...


@dataclass(order=True)
Expand Down
1 change: 0 additions & 1 deletion edc_consent/field_mixins/identity_fields_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class IdentityFieldsMixinError(Exception):


class IdentityFieldsMixin(CryptoMixin, models.Model):

"""
Note: specify identifier_type CHOICES on the form.
For example:
Expand Down
1 change: 0 additions & 1 deletion edc_consent/field_mixins/verification_fields_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@


class VerificationFieldsMixin(models.Model):

"""A fields mixin for models that are verified against a
paper document, such as an ICF.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@


class SubjectConsentFormValidatorMixin(SubjectScreeningFormValidatorMixin):

"""Form Validator mixin for the consent model."""

def __init__(self: Any, **kwargs):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@


class RequiresConsentFieldsModelMixin(models.Model):

"""See pre-save signal that checks if subject is consented"""

consent_model = models.CharField(max_length=50, null=True, editable=False)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@


class RequiresConsentModelFormMixin:

"""Model form mixin for CRF or PRN forms to access the consent.
Use with CrfModelMixin, etc
Expand Down
3 changes: 1 addition & 2 deletions edc_consent/stubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ class ConsentModelStub(Protocol):

class ConsentLikeModel(
SiteModelMixin, ConsentModelMixin, NonUniqueSubjectIdentifierModelMixin
):
...
): ...
3 changes: 1 addition & 2 deletions edc_consent/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@

from .model_mixins import ConsentModelMixin

class ConsentModel(ConsentModelMixin, BaseUuidModel):
...
class ConsentModel(ConsentModelMixin, BaseUuidModel): ...


class InvalidInitials(Exception):
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ exclude =
edc_consent.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
Expand Down

0 comments on commit 9aab9fd

Please sign in to comment.