Skip to content

Commit

Permalink
chore: update pre-commit hooks (#237)
Browse files Browse the repository at this point in the history
* chore: update pre-commit hooks

updates:
- [github.com/psf/black: 24.4.0 → 24.4.2](psf/black@24.4.0...24.4.2)
- [github.com/astral-sh/ruff-pre-commit: v0.4.1 → v0.4.10](astral-sh/ruff-pre-commit@v0.4.1...v0.4.10)
- [github.com/pre-commit/mirrors-mypy: v1.9.0 → v1.10.0](pre-commit/mirrors-mypy@v1.9.0...v1.10.0)
- [github.com/codespell-project/codespell: v2.2.6 → v2.3.0](codespell-project/codespell@v2.2.6...v2.3.0)

* style: pre-commit fixes

* chore: update pre-commit hooks

updates:
- [github.com/psf/black: 24.4.2 → 24.8.0](psf/black@24.4.2...24.8.0)
- [github.com/astral-sh/ruff-pre-commit: v0.5.0 → v0.5.6](astral-sh/ruff-pre-commit@v0.5.0...v0.5.6)
- [github.com/pre-commit/mirrors-mypy: v1.10.1 → v1.11.1](pre-commit/mirrors-mypy@v1.10.1...v1.11.1)

* Fix is None pre-commit check

* test revert

* test is instead of equality

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Connor Stone <connorstone628@gmail.com>
  • Loading branch information
pre-commit-ci[bot] and ConnorStoneAstro authored Aug 8, 2024
1 parent 5935f7a commit dad9ed2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ci:

repos:
- repo: https://github.com/psf/black
rev: "24.4.2"
rev: "24.8.0"
hooks:
- id: black-jupyter

Expand Down Expand Up @@ -51,13 +51,13 @@ repos:
args: [--prose-wrap=always]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.5.0"
rev: "v0.5.6"
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.10.1"
rev: "v1.11.1"
hooks:
- id: mypy
files: src
Expand Down
2 changes: 1 addition & 1 deletion src/caustics/models/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def _init_kwargs_field_check(cls, v, info: ValidationInfo):
field_name = info.field_name
field = cls.model_fields[field_name]
anno_args = typing.get_args(field.annotation)
if len(anno_args) == 2 and anno_args[1] == type(None):
if len(anno_args) == 2 and anno_args[1] is type(None):
# This means that the anno is optional
expected_type = next(
filter(lambda x: x is not None, typing.get_args(field.annotation))
Expand Down

0 comments on commit dad9ed2

Please sign in to comment.