Skip to content

Commit

Permalink
black isnt needed anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonycorletti committed Mar 7, 2024
1 parent 039ae9a commit 6769c4b
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 62 deletions.
4 changes: 0 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
24 changes: 0 additions & 24 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down
8 changes: 1 addition & 7 deletions snok/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()],
)
Expand All @@ -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],
)
Expand All @@ -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 = [
Expand Down
1 change: 0 additions & 1 deletion snok/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

BASE_DEV_DEPS = [
"asgi-lifespan",
"black",
"coverage",
"greenlet",
"invoke",
Expand Down
4 changes: 0 additions & 4 deletions snok/templates/__shared/_.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
19 changes: 0 additions & 19 deletions snok/templates/__shared/_pyproject_toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion snok/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down

0 comments on commit 6769c4b

Please sign in to comment.