Skip to content

Commit

Permalink
chore: switch to Ruff formatter (#746)
Browse files Browse the repository at this point in the history
  • Loading branch information
browniebroke committed May 21, 2024
1 parent 04ac5ff commit c2f43a5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 16 deletions.
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

0 comments on commit c2f43a5

Please sign in to comment.