diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..c2dd2e3 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,11 @@ +repos: + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.6.4 + hooks: + - id: ruff + args: [--fix] + - id: ruff-format + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v1.11.2 + hooks: + - id: mypy diff --git a/pyproject.toml b/pyproject.toml index d16f17f..ed4d540 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,10 +13,59 @@ build-backend = "hatchling.build" [tool.rye] managed = true -dev-dependencies = [] +dev-dependencies = ["mypy~=1.11", "ruff~=0.6", "pre-commit~=3.8", "pytest~=8.3"] [tool.hatch.metadata] allow-direct-references = true [tool.hatch.build.targets.wheel] packages = ["src/bunyan_formatter"] + +[tool.ruff] +show-fixes = true +line-length = 120 +indent-width = 4 +target-version = "py38" + +[tool.ruff.lint] +extend-select = [ + "B", + "BLE", + "C4", + "ERA", + "I", + "ICN", + "INP", + "ISC", + "N", + "NPY", + "PGH", + "PIE", + "PT", + "Q", + "RET", + "RSE", + "RUF", + "S", + "SIM", + "T20", + "TCH", + "TID", + "YTT", +] +preview = true +fixable = ["ALL"] +ignore = ["E741", "ISC001"] + + +[tool.ruff.lint.extend-per-file-ignores] +# Disable for all files in the tests directory +"**/tests/*" = ["S101", "S106", "PLR2004"] + +[tool.ruff.format] +quote-style = "double" +indent-style = "space" +skip-magic-trailing-comma = false +line-ending = "auto" +docstring-code-format = true +docstring-code-line-length = 40 diff --git a/requirements-dev.lock b/requirements-dev.lock new file mode 100644 index 0000000..140a887 --- /dev/null +++ b/requirements-dev.lock @@ -0,0 +1,42 @@ +# generated by rye +# use `rye lock` or `rye sync` to update this lockfile +# +# last locked with the following flags: +# pre: false +# features: [] +# all-features: false +# with-sources: false +# generate-hashes: false +# universal: false + +-e file:. +cfgv==3.4.0 + # via pre-commit +distlib==0.3.8 + # via virtualenv +filelock==3.16.0 + # via virtualenv +identify==2.6.0 + # via pre-commit +iniconfig==2.0.0 + # via pytest +mypy==1.11.2 +mypy-extensions==1.0.0 + # via mypy +nodeenv==1.9.1 + # via pre-commit +packaging==24.1 + # via pytest +platformdirs==4.3.2 + # via virtualenv +pluggy==1.5.0 + # via pytest +pre-commit==3.8.0 +pytest==8.3.3 +pyyaml==6.0.2 + # via pre-commit +ruff==0.6.4 +typing-extensions==4.12.2 + # via mypy +virtualenv==20.26.4 + # via pre-commit diff --git a/requirements.lock b/requirements.lock new file mode 100644 index 0000000..505fd45 --- /dev/null +++ b/requirements.lock @@ -0,0 +1,12 @@ +# generated by rye +# use `rye lock` or `rye sync` to update this lockfile +# +# last locked with the following flags: +# pre: false +# features: [] +# all-features: false +# with-sources: false +# generate-hashes: false +# universal: false + +-e file:. diff --git a/src/bunyan_formatter/py.typed b/src/bunyan_formatter/py.typed new file mode 100644 index 0000000..e69de29