Skip to content

Commit

Permalink
Replace black and pylint with ruff (#8)
Browse files Browse the repository at this point in the history
* Replace black and pylint with ruff

* Add ruff extension to vscode

* Add venv bin to remoteEnv
  • Loading branch information
razor-x authored Jun 6, 2024
1 parent 6883d07 commit d036fc7
Show file tree
Hide file tree
Showing 7 changed files with 234 additions and 415 deletions.
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
},
"remoteEnv": {
"POETRY_VIRTUALENVS_IN_PROJECT": "true",
"PATH": "${containerEnv:PATH}:/home/vscode/.local/bin"
"PATH": "${containerEnv:PATH}:/home/vscode/.local/bin:/workspaces/pypackage/.venv/bin"
},
"extensions": [
"ms-vsliveshare.vsliveshare",
"ms-python.python",
"charliermarsh.ruff",
"EditorConfig.EditorConfig"
],
"postCreateCommand": "poetry install",
Expand Down
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ build:
@poetry build

format:
@poetry run black .
@poetry run ruff check --fix
@poetry run ruff format

lint:
@poetry run pylint ./makenew_pypackage
@poetry run black --check .
@poetry run ruff check
@poetry run ruff format --check
@poetry run rstcheck README.rst

test:
Expand Down
6 changes: 2 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ Features

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

.. _Black: https://black.readthedocs.io/en/stable/
.. _Codecov: https://codecov.io/
.. _EditorConfig: https://editorconfig.org/
.. _GitHub Codespaces: https://github.com/features/codespaces
.. _Keep a CHANGELOG: https://keepachangelog.com/
.. _PyPI: https://pypi.python.org/pypi
.. _Pylint: https://www.pylint.org/
.. _Ruff: https://github.com/astral-sh/ruff
.. _Shields.io: https://shields.io/
.. __: https://semantic-release.gitbook.io/semantic-release/
.. __: https://github.com/features/actions
Expand Down
2 changes: 1 addition & 1 deletion makenew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ makenew () {
read -p '> GitHub user or organization name (my-user): ' mk_user
read -p '> GitHub repository name (my-repo): ' mk_repo

sed_delete README.rst '18,130d'
sed_delete README.rst '18,128d'
sed_insert README.rst '18i' 'TODO'

old_title="Python Package Skeleton"
Expand Down
5 changes: 0 additions & 5 deletions makenew_pypackage/todo_test.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# pylint: disable=missing-docstring
# pylint: disable=unused-import

import pytest

from .todo import todo


Expand Down
623 changes: 224 additions & 399 deletions poetry.lock

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ repository = "https://github.com/makenew/pypackage"
python = "^3.11.0"

[tool.poetry.group.dev.dependencies]
black = "^24.3.0"
pylint = "^3.1.0"
pytest = "^8.1.1"
pytest-cov = "^5.0.0"
pytest-runner = "^6.0.0"
pytest-watch = "^4.2.0"
rstcheck = "^6.1.2"
ruff = "^0.4.8"

[build-system]
requires = ["poetry>=1.8"]
Expand Down

0 comments on commit d036fc7

Please sign in to comment.