From 6769c4b7d7ac7ca3064a30c72756476813e9b6b2 Mon Sep 17 00:00:00 2001 From: Anthony Corletti Date: Thu, 7 Mar 2024 17:30:35 -0500 Subject: [PATCH] black isnt needed anymore --- .pre-commit-config.yaml | 4 ---- README.md | 2 +- docs/index.md | 2 +- pyproject.toml | 24 ------------------- snok/cli.py | 8 +------ snok/const.py | 1 - .../__shared/_.pre-commit-config.yaml | 4 ---- snok/templates/__shared/_pyproject_toml | 19 --------------- snok/utils.py | 2 +- 9 files changed, 4 insertions(+), 62 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b583ecc..04e3bbf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,10 +11,6 @@ repos: - --unsafe - id: end-of-file-fixer - id: trailing-whitespace - - repo: https://github.com/psf/black - rev: 24.1.1 - hooks: - - id: black - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.2.1 hooks: diff --git a/README.md b/README.md index f63e770..38dd609 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Snok is designed for the programmer, and not much else. - Package generation - Built-in dependency management - Packaging with `setuptools` -- Linting and formatting with `ruff` and `black` +- Linting and formatting with `ruff` - Type checking with `mypy` - Async, multi-worker testing with `pytest` - Async API scaffolding with `fastapi` diff --git a/docs/index.md b/docs/index.md index f63e770..38dd609 100644 --- a/docs/index.md +++ b/docs/index.md @@ -48,7 +48,7 @@ Snok is designed for the programmer, and not much else. - Package generation - Built-in dependency management - Packaging with `setuptools` -- Linting and formatting with `ruff` and `black` +- Linting and formatting with `ruff` - Type checking with `mypy` - Async, multi-worker testing with `pytest` - Async API scaffolding with `fastapi` diff --git a/pyproject.toml b/pyproject.toml index 19cd121..193b1dc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,6 @@ text = "MIT" [project.optional-dependencies] dev = [ "asgi-lifespan>=2.1.0", - "black>=21.10", "coverage>=7.2.7", "greenlet>=2.0.2", "mdx-include>=1.4.2", @@ -85,29 +84,6 @@ select = ["E", "F", "I"] [tool.ruff.lint.pydocstyle] convention = "google" -[tool.black] -target-version = ["py311"] -include = '\.pyi?$' -exclude = ''' -/( - \.eggs - | \.git - | \.hg - | \.*_cache - | \.tox - | \.venv - | build - | dist - | __pycache__ - | snok/templates/* -)/ -''' -force-exclude = ''' -/( - snok/templates/* -)/ -''' - [tool.mypy] python_version = "3.11" ignore_missing_imports = true diff --git a/snok/cli.py b/snok/cli.py index a238b20..21863eb 100644 --- a/snok/cli.py +++ b/snok/cli.py @@ -261,9 +261,6 @@ def _lint() -> None: # pragma: no cover _run_cmd( ["mypy", *_snok_sources()], ) - _run_cmd( - ["black", "--check", *_snok_sources()], - ) _run_cmd( ["ruff", *_snok_sources()], ) @@ -282,9 +279,6 @@ def _format( if not isinstance(extra_paths, list): extra_paths = [] echo("Formatting...") - _run_cmd( - ["black", *_snok_sources(), *extra_paths], - ) _run_cmd( ["ruff", "--fix", *_snok_sources(), *extra_paths], ) @@ -299,7 +293,7 @@ def _test( False, "--keepitonehundred", help="Fail if the test coverage is less than 100%. Defaults to False.", - ) + ), ) -> None: # pragma: no cover echo("Running tests...") cmd = [ diff --git a/snok/const.py b/snok/const.py index 9fe03c8..1183f9d 100644 --- a/snok/const.py +++ b/snok/const.py @@ -23,7 +23,6 @@ BASE_DEV_DEPS = [ "asgi-lifespan", - "black", "coverage", "greenlet", "invoke", diff --git a/snok/templates/__shared/_.pre-commit-config.yaml b/snok/templates/__shared/_.pre-commit-config.yaml index 31a8f63..ce10ceb 100644 --- a/snok/templates/__shared/_.pre-commit-config.yaml +++ b/snok/templates/__shared/_.pre-commit-config.yaml @@ -11,10 +11,6 @@ repos: - --unsafe - id: end-of-file-fixer - id: trailing-whitespace - - repo: https://github.com/psf/black - rev: 23.3.0 - hooks: - - id: black - repo: https://github.com/charliermarsh/ruff-pre-commit rev: v0.0.265 hooks: diff --git a/snok/templates/__shared/_pyproject_toml b/snok/templates/__shared/_pyproject_toml index 6615a77..7c79fe2 100644 --- a/snok/templates/__shared/_pyproject_toml +++ b/snok/templates/__shared/_pyproject_toml @@ -70,25 +70,6 @@ select = [ convention = "google" -[tool.black] -target-version = [ - "py310", -] -include = '\.pyi?$' -exclude = ''' -/( - \.eggs - | \.git - | \.hg - | \.*_cache - | \.tox - | \.venv - | build - | dist - | __pycache__ -)/ -''' - [tool.mypy] python_version = "3.11" ignore_missing_imports = true diff --git a/snok/utils.py b/snok/utils.py index 988197a..6e91479 100644 --- a/snok/utils.py +++ b/snok/utils.py @@ -147,7 +147,7 @@ def _update_pyproject_toml( def _snok_sources() -> List[str]: # pragma: no cover - """Returns the list of sources to lint with mypy, black, + """Returns the list of sources to lint with mypy, and ruff from pyproject.toml.""" pyproject_toml = toml.load(PYPROJECT_TOML_FILENAME) return pyproject_toml["tool"]["snok"]["sources"]