Skip to content
Closed
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
4 changes: 3 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.12.7"
rev: "v0.12.11"
hooks:
- id: ruff-check
args: [ --fix, --exit-non-zero-on-fix ]
Expand All @@ -41,3 +41,5 @@ repos:
entry: uvx toml-sort --in-place --all pyproject.toml
language: system
files: ^pyproject.toml$

minimum_pre_commit_version: 4.3.0
124 changes: 65 additions & 59 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ dev = [
"mkdocs>=1.6",
"mkdocstrings[python]>=0.30",
"mypy>=1.17",
"pre-commit>=3.8",
"pre-commit>=4.3",
"pytest-cov>=4.1",
"pytest>=7.4",
"ruff>=0.12",
"ruff==0.12.11",
"tox-uv>=1.28"
]

Expand Down Expand Up @@ -108,75 +108,81 @@ markers = [
testpaths = ["tests"]

[tool.ruff]
exclude = [
"bin",
"docs",
"sbin"
]
fix = true
line-length = 100
src = ["src", "tests"]
target-version = "py39"

[tool.ruff.format]
docstring-code-format = true
preview = true
quote-style = "double"

[tool.ruff.lint]
fixable = [
"B",
"C4",
"D",
"EM",
"F401",
"F541",
"I",
"PERF",
"PIE",
"PT",
"RET",
"RSE",
"RUF",
"SIM",
"UP"
]
ignore = [
"E111",
"E114",
"E117",
"E501",
"E731",
"PLR0913",
"S321",
"W191"
]
select = [
"A", # https://docs.astral.sh/ruff/rules/#flake8-builtins-a
"ARG", # https://docs.astral.sh/ruff/rules/#flake8-unused-arguments-arg
"B", # https://docs.astral.sh/ruff/rules/#flake8-bugbear-b
"C4", # https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4
"DTZ", # https://docs.astral.sh/ruff/rules/#flake8-datetimez-dtz
"E",
"EM", # https://docs.astral.sh/ruff/rules/#flake8-errmsg-em
"F", # https://docs.astral.sh/ruff/rules/#pyflakes-f
"G", # https://docs.astral.sh/ruff/rules/#flake8-logging-format-g
"I", # https://docs.astral.sh/ruff/rules/#isort-i
"LOG", # https://docs.astral.sh/ruff/rules/#flake8-logging-log
"N", # https://docs.astral.sh/ruff/rules/#pep8-naming-n
"PERF", # https://docs.astral.sh/ruff/rules/#perflint-perf
"PIE", # https://docs.astral.sh/ruff/rules/#flake8-pie-pie
"PL", # https://docs.astral.sh/ruff/rules/#pylint-pl
"PT", # https://docs.astral.sh/ruff/rules/#flake8-pytest-style-pt
"PTH", # https://docs.astral.sh/ruff/rules/#flake8-use-pathlib-pth
"RET", # https://docs.astral.sh/ruff/rules/#flake8-return-ret
"RSE", # https://docs.astral.sh/ruff/rules/#flake8-raise-rse
"RUF", # https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
"S", # https://docs.astral.sh/ruff/rules/#flake8-bandit-s
"SIM", # https://docs.astral.sh/ruff/rules/#flake8-simplify-sim
"TRY", # https://docs.astral.sh/ruff/rules/#tryceratops-try
"UP", # https://docs.astral.sh/ruff/rules/#pyupgrade-up
"W", # https://docs.astral.sh/ruff/rules/#pycodestyle-e-w
"YTT" # https://docs.astral.sh/ruff/rules/#flake8-2020-ytt
"AIR",
"ANN002",
"ANN003",
"C90",
"COM812", # ignore for compatibility with formatter
"CPY",
"D105",
"D203",
"D205",
"D206",
"D213", # conflicts with D212
"D300", # ignore for compatibility with formatter
"D400",
"D401",
"D403",
"D415",
"DJ",
"E111", # ignore for compatibility with formatter
"E114", # ignore for compatibility with formatter
"E117", # ignore for compatibility with formatter
"E501", # ignore for compatibility with formatter
"EM",
"ERA",
"EXE",
"FA",
"FAST",
"FBT",
"FIX",
"INT",
"NPY",
"PD",
"PGH003",
"PLR0904", # subjective pylint threshold
"PLR091", # subjective pylint threshold
"PLR1702", # subjective pylint threshold
"PYI",
"RET504",
"TC",
"TD",
"TID",
"TRY003",
"W191",
"YTT"
]
select = ["ALL"]

[tool.ruff.lint.flake8-annotations]
mypy-init-return = true

[tool.ruff.lint.per-file-ignores]
"tests/*" = ["S101"]
"tests/*" = [
"ANN001",
"ANN2",
"B011",
"BLE001",
"D10",
"D100",
"INP001",
"S101",
"SLF001"
]

[tool.setuptools]
include-package-data = true
Expand Down
6 changes: 3 additions & 3 deletions src/biocommons/example/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
_logger = logging.getLogger(__name__)


def main(): # pragma: no cover
def main() -> None: # pragma: no cover
"""marvin.example main"""
import coloredlogs # noqa: PLC0415

Expand All @@ -22,8 +22,8 @@ def main(): # pragma: no cover
quote = marvin.get_quote()
_logger.warning("Got quote from Marvin (len=%s)", len(quote))

print("Marvin says:")
print(quote)
print("Marvin says:") # noqa: T201
print(quote) # noqa: T201


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion src/biocommons/example/marvin_adjacent_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
from .marvin import get_quote


def test_get_quote():
def test_get_quote() -> None:
"""test get_quote"""
assert get_quote() is not None # noqa: S101
50 changes: 25 additions & 25 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.