From 130c0ac95fb985d465dced52a34c6c7b05ba9599 Mon Sep 17 00:00:00 2001 From: Davy Peter Braun <543614+dheavy@users.noreply.github.com> Date: Sun, 7 Apr 2024 15:13:03 +0200 Subject: [PATCH] Change linter, ruff to black --- .pre-commit-config.yaml | 9 ++++----- CONTRIBUTING.md | 6 +++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 913aeb4d..54b74a1f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,10 +1,9 @@ repos: - - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.2.2" + - repo: https://github.com/psf/black + rev: 24.3.0 # Use the latest revision of Black hooks: - - id: ruff - args: ["--fix"] - - id: ruff-format + - id: black + language_version: python3 - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.5.0 hooks: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c6aa693c..61c11716 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -55,7 +55,7 @@ Then run `poetry install` again. If this doesn't work, please join our [Discord ## Code Formatting and Linting -Our project uses `ruff` for code formatting and `isort` for import sorting. To ensure consistency across contributions, please adhere to the following guidelines: +Our project uses `black` for code formatting and `isort` for import sorting. To ensure consistency across contributions, please adhere to the following guidelines: 1. **Install Pre-commit Hooks**: @@ -63,7 +63,7 @@ Our project uses `ruff` for code formatting and `isort` for import sorting. To e ```bash cd software # Change into `software` directory if not there already. - poetry shell # /!\ You MUST do it the virtual environment of your project + poetry shell # It's better to do it within the virtual environment of your project poetry add --dev pre-commit # Install pre-commit as a dev dependency pre-commit install ``` @@ -75,7 +75,7 @@ Our project uses `ruff` for code formatting and `isort` for import sorting. To e If you choose not to use the pre-commit hooks, you can manually format your code using: ```bash - ruff . + black . isort . ```