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

chore: switch to Ruff formatter #746

Merged
merged 2 commits into from
May 21, 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
5 changes: 1 addition & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ repos:
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black
- id: ruff-format
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ Project template for a Python Package using Copier.
- Testing with Pytest using GitHub actions.
- Packaging powered by [poetry].
- Optionally generates a CLI entry point powered by [Typer] and [Rich].
- Follows the [black] style guide.
- Uses [Ruff] for linting.
- Comes with [pre-commit] hook config for [black] and [Ruff].
- Uses [Ruff] for formatting and linting.
- Comes with [pre-commit] hook config for [Ruff].
- Style guide enforced on CI.
- Dependencies kept up to date by [Renovate].
- Follow the [all-contributors] specification.
Expand Down Expand Up @@ -58,8 +57,8 @@ When you first push to GitHub, it'll start a `ci` GitHub workflow that you can s

- The `test` job will run your test suite with Pytest against all Python version from 3.8 to 3.11
- A few things will run in the lint job:
- black in check mode
- Ruff with several flake8 plugins, isort and pyupgrade plugins.
- Ruff format
- Ruff lint with several flake8, isort and pyupgrade plugins.

A `labels` workflow will also run and synchronise the GitHub labels based on the `.github/labels.toml` file.

Expand Down Expand Up @@ -142,7 +141,6 @@ This project follows the [all-contributors](https://github.com/all-contributors/
[poetry]: https://python-poetry.org
[Typer]: https://typer.tiangolo.com
[Rich]: https://rich.readthedocs.io
[black]: https://github.com/psf/black
[Ruff]: https://pypi.org/project/ruff/
[pre-commit]: https://pre-commit.com/
[renovate]: https://docs.renovatebot.com/
Expand Down
5 changes: 1 addition & 4 deletions project/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@ repos:
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black
- id: ruff-format
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
Expand Down
4 changes: 2 additions & 2 deletions project/README.md.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
<a href="https://python-poetry.org/">
<img src="https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json" alt="Poetry">
</a>
<a href="https://github.com/ambv/black">
<img src="https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square" alt="black">
<a href="https://github.com/astral-sh/ruff">
<img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Ruff">
</a>
<a href="https://github.com/pre-commit/pre-commit">
<img src="https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&style=flat-square" alt="pre-commit">
Expand Down
Loading