Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pre-commit hooks to latest #1547

Merged
merged 2 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
repos:
# Versioning: Commit messages & changelog
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.13.0
rev: v3.27.0
hooks:
- id: commitizen
stages: [commit-msg]

# Lint / autoformat: Python code
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: "v0.1.13"
rev: "v0.4.7"
hooks:
# Run the linter
- id: ruff
Expand All @@ -28,15 +28,15 @@ repos:

# Spelling: Checks for common misspellings in text files.
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
types: [text]
args: [--toml, src/backend/pyproject.toml]

# Autoformat: YAML, JSON, Markdown, etc.
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
rev: v4.0.0-alpha.8
hooks:
- id: prettier
entry: env PRETTIER_LEGACY_CLI=1 prettier
Expand Down Expand Up @@ -66,7 +66,7 @@ repos:

# Lint & Autoformat: SQL
- repo: https://github.com/sqlfluff/sqlfluff
rev: 3.0.6
rev: 3.0.7
hooks:
- id: sqlfluff-lint
files: ^src/backend/migrations/(?:.*/)*.*$
Expand All @@ -84,15 +84,15 @@ repos:

# Lint: Shell scripts
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.6
rev: v0.10.0.1
hooks:
- id: shellcheck
files: ^(?!.*(?:^|/)contrib(?:/|$)).*$
args: ["-x", "--exclude=SC2317,SC2188,SC2143"]

# Lint: Markdown
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.38.0
rev: v0.41.0
hooks:
- id: markdownlint
args:
Expand Down
1 change: 1 addition & 0 deletions src/backend/app/auth/auth_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#

"""Auth routes, to login, logout, and get user details."""

from datetime import datetime, timezone

from fastapi import APIRouter, Depends, HTTPException, Request, Response
Expand Down
1 change: 0 additions & 1 deletion src/backend/app/central/central_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#
"""Routes to relay requests to ODK Central server."""


from fastapi import APIRouter, Depends
from fastapi.concurrency import run_in_threadpool
from fastapi.responses import JSONResponse
Expand Down
2 changes: 1 addition & 1 deletion src/backend/app/db/db_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ class DbTaskMappingIssue(Base):


class DbMappingIssueCategory(Base):
"""Represents a category of task mapping issues identified during validaton."""
"""Represents a category of task mapping issues identified during validation."""

__tablename__ = "mapping_issue_categories"

Expand Down
1 change: 0 additions & 1 deletion src/backend/app/users/user_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#
"""Logic for user routes."""


from sqlalchemy.orm import Session

from app.db import db_models
Expand Down
1 change: 0 additions & 1 deletion src/backend/app/users/user_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

"""User dependencies for use in Depends."""


from typing import Union

from fastapi import Depends
Expand Down
11 changes: 6 additions & 5 deletions src/backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,17 @@ target-versions = ["py310", "py311"]
[tool.ruff]
target-version = "py310"
line-length = 88
select = ["I", "E", "W", "D", "B", "F", "N", "Q"]
ignore = ["N805", "B008"]
exclude = [
".ruff_cache",
"__pypackages__",
"app/__version__.py",
]
[tool.ruff.pydocstyle]
[tool.ruff.lint]
select = ["I", "E", "W", "D", "B", "F", "N", "Q"]
ignore = ["N805", "B008"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.flake8-bugbear]
[tool.ruff.lint.flake8-bugbear]
extend-immutable-calls = [
"fastapi.Depends",
"fastapi.params.Depends",
Expand Down Expand Up @@ -155,5 +156,5 @@ exclude_rules = "CP05" # Avoid capitalisation of enums

[tool.codespell]
skip = "contrib/*.py,*languages_and_countries.py,*pnpm-lock.yaml,*CHANGELOG.md"
ignore-words-list = "ProjectIn"
write-changes = true

Loading