Skip to content

Commit

Permalink
Update pre-commit libraries (#1118)
Browse files Browse the repository at this point in the history
  • Loading branch information
michplunkett authored Aug 7, 2024
1 parent 7537e32 commit d68c5d8
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 25 deletions.
26 changes: 6 additions & 20 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: check-docstring-first
Expand Down Expand Up @@ -31,7 +31,7 @@ repos:
- id: python-no-log-warn

- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
name: Run isort to sort imports
Expand All @@ -42,20 +42,6 @@ repos:
- --lines-after-imports=2
- --profile=black

- repo: https://github.com/pycqa/pydocstyle
rev: 6.3.0
hooks:
- id: pydocstyle
name: Run pydocstyle
args:
- --convention=pep257
# Do not require docstrings, only check existing ones. (D1)
# Allow for a newline after a docstring. (D202)
# Don't require a summary line. (D205)
# Don't require a period on the first line. (D400)
- --add-ignore=D1,D202,D205,D400
exclude: tests/

- repo: local
hooks:
- id: no-shebang
Expand All @@ -68,7 +54,7 @@ repos:
files: \.py$

- repo: https://github.com/ikamensh/flynt/
rev: '1.0.0'
rev: 1.0.1
hooks:
- id: flynt
exclude: ^build/.*$|^.tox/.*$|^venv/.*$
Expand All @@ -77,7 +63,7 @@ repos:
- --quiet

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.10
rev: v0.5.5
hooks:
- id: ruff
types_or: [python,pyi]
Expand All @@ -91,12 +77,12 @@ repos:
- --target-version=py311

- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.4.1'
rev: v1.11.0
hooks:
- id: mypy

- repo: https://github.com/Riverside-Healthcare/djLint
rev: v1.32.1
rev: v1.34.1
hooks:
- id: djlint-reformat
pass_filenames: false
Expand Down
4 changes: 2 additions & 2 deletions OpenOversight/app/main/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ class DateFieldForm(Form):
time_field = TimeField("Time", validators=[Optional()])

def validate_time_field(self, field):
if not type(field.data) == time:
if type(field.data) is not time:
raise ValidationError("Not a valid time.")

def validate_date_field(self, field):
Expand Down Expand Up @@ -491,7 +491,7 @@ def validate_state(self, field):

class OfficerIdField(StringField):
def process_data(self, value):
if type(value) == Officer:
if type(value) is Officer:
self.data = value.id
else:
self.data = value
Expand Down
2 changes: 1 addition & 1 deletion OpenOversight/app/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def __call__(self, field, **kwargs):
kwargs.setdefault("id", field.id)
html = [f"<{self.html_tag} {html_params(**kwargs)}>"]
for subfield in field:
if type(subfield) == FormField:
if type(subfield) is FormField:
html.append(f"<li><h6>{subfield.label.text}</h6> {subfield()}</li>")
if self.prefix_label:
html.append(
Expand Down
2 changes: 1 addition & 1 deletion OpenOversight/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def test_save_image_to_s3_and_db_returns_existing_image(
test_png_bytes_io.close = lambda: None
firstUpload = save_image_to_s3_and_db(test_png_bytes_io, 1, 1)
secondUpload = save_image_to_s3_and_db(test_png_bytes_io, 1, 1)
assert type(secondUpload) == Image
assert type(secondUpload) is Image
assert firstUpload.id == secondUpload.id


Expand Down
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ faker==18.11.2
mock==5.0.2
nose>=1.3.1
pandas>=0.23.4
pre-commit==3.3.3
pre-commit==3.8.0
pytest==7.4.0
pytest-cov==4.1.0
pytest-pep8==1.0.6
Expand Down

0 comments on commit d68c5d8

Please sign in to comment.