Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace black and pylint with ruff #8

Merged
merged 3 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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