-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update pre-commit and use ruff for linting/formating (#105)
* update pre-commit and use ruff for linting/formating * use python 3.11 for lint * try pydantic 1. --------- Co-authored-by: Jonathan Healy <[email protected]>
- Loading branch information
1 parent
fcf4935
commit 46a28ee
Showing
17 changed files
with
169 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,24 @@ | ||
repos: | ||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.12.0 | ||
rev: 5.13.2 | ||
hooks: | ||
- id: isort | ||
language_version: python | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 22.12.0 | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.3.5 | ||
hooks: | ||
- id: black | ||
args: ["--safe"] | ||
language_version: python | ||
|
||
- repo: https://github.com/pycqa/flake8 | ||
rev: 6.0.0 | ||
hooks: | ||
- id: flake8 | ||
language_version: python | ||
args: [ | ||
# E501 let black handle all line length decisions | ||
# W503 black conflicts with "line break before operator" rule | ||
# E203 black conflicts with "whitespace before ':'" rule | ||
"--ignore=E501,W503,E203,C901", | ||
] | ||
- repo: https://github.com/chewse/pre-commit-mirrors-pydocstyle | ||
# 2.1.1 | ||
rev: v2.1.1 | ||
hooks: | ||
- id: pydocstyle | ||
language_version: python | ||
exclude: ".*(test|scripts).*" | ||
args: | ||
[ | ||
# Check for docstring presence only | ||
"--select=D1", | ||
] | ||
# Don't require docstrings for tests | ||
# '--match=(?!test).*\.py'] | ||
# - | ||
# repo: https://github.com/pre-commit/mirrors-mypy | ||
# rev: v0.770 | ||
# hooks: | ||
# - id: mypy | ||
# language_version: python3.8 | ||
# args: [--no-strict-optional, --ignore-missing-imports] | ||
- id: ruff | ||
args: ["--fix"] | ||
- id: ruff-format | ||
|
||
- repo: https://github.com/PyCQA/pydocstyle | ||
rev: 6.3.0 | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.9.0 | ||
hooks: | ||
- id: pydocstyle | ||
- id: mypy | ||
language_version: python | ||
exclude: ".*(test|scripts).*" | ||
#args: [ | ||
# Don't require docstrings for tests | ||
#'--match=(?!test|scripts).*\.py', | ||
#] | ||
exclude: tests/.* | ||
additional_dependencies: | ||
- types-requests | ||
- types-attrs | ||
- pydantic~=1.10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,28 @@ | ||
[flake8] | ||
ignore = "D203" | ||
exclude = [".git", "__pycache__", "docs/source/conf.py", "build", "dist"] | ||
max-complexity = 12 | ||
max-line-length = 90 | ||
|
||
[tool.isort] | ||
profile = "black" | ||
known_first_party = "stac_fastapi.pgstac" | ||
known_third_party = ["rasterio", "stac-pydantic", "sqlalchemy", "geoalchemy2", "fastapi", "stac_fastapi"] | ||
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"] | ||
|
||
[tool.mypy] | ||
ignore_missing_imports = true | ||
namespace_packages = true | ||
explicit_package_bases = true | ||
exclude = ["tests", ".venv"] | ||
|
||
[tool.ruff] | ||
line-length = 90 | ||
|
||
[tool.ruff.lint] | ||
select = [ | ||
"C", | ||
"E", | ||
"F", | ||
"W", | ||
"B", | ||
] | ||
ignore = [ | ||
"E203", # line too long, handled by black | ||
"E501", # do not perform function calls in argument defaults | ||
"B028", # No explicit `stacklevel` keyword argument found | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
"""Ingest sample data during docker-compose""" | ||
|
||
import json | ||
import sys | ||
from pathlib import Path | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
"""Get Queryables.""" | ||
|
||
from typing import Any, Optional | ||
|
||
from buildpg import render | ||
|
Oops, something went wrong.