Skip to content

Commit d036fc7

Browse files
authored
Replace black and pylint with ruff (#8)
* Replace black and pylint with ruff * Add ruff extension to vscode * Add venv bin to remoteEnv
1 parent 6883d07 commit d036fc7

File tree

7 files changed

+234
-415
lines changed

7 files changed

+234
-415
lines changed

.devcontainer/devcontainer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@
1010
},
1111
"remoteEnv": {
1212
"POETRY_VIRTUALENVS_IN_PROJECT": "true",
13-
"PATH": "${containerEnv:PATH}:/home/vscode/.local/bin"
13+
"PATH": "${containerEnv:PATH}:/home/vscode/.local/bin:/workspaces/pypackage/.venv/bin"
1414
},
1515
"extensions": [
1616
"ms-vsliveshare.vsliveshare",
1717
"ms-python.python",
18+
"charliermarsh.ruff",
1819
"EditorConfig.EditorConfig"
1920
],
2021
"postCreateCommand": "poetry install",

Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ build:
55
@poetry build
66

77
format:
8-
@poetry run black .
8+
@poetry run ruff check --fix
9+
@poetry run ruff format
910

1011
lint:
11-
@poetry run pylint ./makenew_pypackage
12-
@poetry run black --check .
12+
@poetry run ruff check
13+
@poetry run ruff format --check
1314
@poetry run rstcheck README.rst
1415

1516
test:

README.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ Features
2424

2525
- Publishing to PyPI_.
2626
- Secure dependency management with Poetry_.
27-
- Linting with Pylint_.
28-
- Uncompromising code formatting with Black_.
27+
- Extremely fast Python linting and code formatting with Ruff_.
2928
- pytest_ helps you write better programs.
3029
- Code coverage reporting with Codecov_.
3130
- Fully automated version management and package publishing with semantic-release__.
@@ -35,13 +34,12 @@ Features
3534
- Badges from Shields.io_.
3635
- Start coding instantly with `GitHub Codespaces`_.
3736

38-
.. _Black: https://black.readthedocs.io/en/stable/
3937
.. _Codecov: https://codecov.io/
4038
.. _EditorConfig: https://editorconfig.org/
4139
.. _GitHub Codespaces: https://github.com/features/codespaces
4240
.. _Keep a CHANGELOG: https://keepachangelog.com/
4341
.. _PyPI: https://pypi.python.org/pypi
44-
.. _Pylint: https://www.pylint.org/
42+
.. _Ruff: https://github.com/astral-sh/ruff
4543
.. _Shields.io: https://shields.io/
4644
.. __: https://semantic-release.gitbook.io/semantic-release/
4745
.. __: https://github.com/features/actions

makenew.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ makenew () {
5959
read -p '> GitHub user or organization name (my-user): ' mk_user
6060
read -p '> GitHub repository name (my-repo): ' mk_repo
6161

62-
sed_delete README.rst '18,130d'
62+
sed_delete README.rst '18,128d'
6363
sed_insert README.rst '18i' 'TODO'
6464

6565
old_title="Python Package Skeleton"

makenew_pypackage/todo_test.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
# pylint: disable=missing-docstring
2-
# pylint: disable=unused-import
3-
4-
import pytest
5-
61
from .todo import todo
72

83

poetry.lock

Lines changed: 224 additions & 399 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,12 @@ repository = "https://github.com/makenew/pypackage"
1212
python = "^3.11.0"
1313

1414
[tool.poetry.group.dev.dependencies]
15-
black = "^24.3.0"
16-
pylint = "^3.1.0"
1715
pytest = "^8.1.1"
1816
pytest-cov = "^5.0.0"
1917
pytest-runner = "^6.0.0"
2018
pytest-watch = "^4.2.0"
2119
rstcheck = "^6.1.2"
20+
ruff = "^0.4.8"
2221

2322
[build-system]
2423
requires = ["poetry>=1.8"]

0 commit comments

Comments
 (0)