From 9b3cf81e87fcd927575cb85bcc9d3197f1a3f2a4 Mon Sep 17 00:00:00 2001 From: Dmitry Volodin Date: Sun, 2 Mar 2025 09:55:29 +0100 Subject: [PATCH] Use ruff for formatting --- .devcontainer/devcontainer.json | 4 +--- .github/workflows/py-tests.yml | 2 +- CHANGELOG.md | 4 ++++ src/gufo/thor/__init__.py | 1 + src/gufo/thor/cli.py | 1 + src/gufo/thor/services/bh.py | 1 + tests/test_docs.py | 4 +--- 7 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index ffcb8a4..d3fab7f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -26,8 +26,7 @@ "settings": { "python.defaultInterpreterPath": "/usr/local/bin/python", "[python]": { - "editor.defaultFormatter": "ms-python.black-formatter", - "black-formatter.path": "/usr/local/bin/black", + "editor.defaultFormatter": "charliermarsh.ruff", "editor.formatOnSave": true, "editor.codeActionsOnSave": { "source.fixAll": true @@ -45,7 +44,6 @@ // Add the IDs of extensions you want installed when the container is created. "extensions": [ "ms-python.python", - "ms-python.black-formatter", "yzhang.markdown-all-in-one", "ms-azuretools.vscode-docker", "be5invis.toml", diff --git a/.github/workflows/py-tests.yml b/.github/workflows/py-tests.yml index 50a0146..5fc9436 100644 --- a/.github/workflows/py-tests.yml +++ b/.github/workflows/py-tests.yml @@ -52,7 +52,7 @@ jobs: run: pip install -IU -r ./.requirements/deps.txt -r ./.requirements/lint.txt -r ./.requirements/test.txt - name: Check Formatting - run: black --check src/ tests/ + run: ruff format --check src/ tests/ - name: Check Ruff run: ruff -q src/ tests/ diff --git a/CHANGELOG.md b/CHANGELOG.md index f6a4957..0c82d66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,10 @@ To see unreleased changes, please see the [CHANGELOG on the master branch](https * Kafka flushes every message on single-node installations. +### Infrastructure + +* Use `ruff` for formatting + ## 0.7.0 - 2025-01-23 ### Fixed diff --git a/src/gufo/thor/__init__.py b/src/gufo/thor/__init__.py index c6b532e..170f0d5 100644 --- a/src/gufo/thor/__init__.py +++ b/src/gufo/thor/__init__.py @@ -9,4 +9,5 @@ Attributes: __version__: Gufo Thor version """ + __version__: str = "0.7.0" diff --git a/src/gufo/thor/cli.py b/src/gufo/thor/cli.py index 91cf22e..7a172c9 100644 --- a/src/gufo/thor/cli.py +++ b/src/gufo/thor/cli.py @@ -9,6 +9,7 @@ Attributes: NAME: Utility name """ + # Python modules import argparse import contextlib diff --git a/src/gufo/thor/services/bh.py b/src/gufo/thor/services/bh.py index 8ee18d3..df5b955 100644 --- a/src/gufo/thor/services/bh.py +++ b/src/gufo/thor/services/bh.py @@ -9,6 +9,7 @@ Attributes: bh: bh service singleton. """ + # Gufo Thor modules from .noc import NocService diff --git a/tests/test_docs.py b/tests/test_docs.py index e8c8172..aff3d36 100644 --- a/tests/test_docs.py +++ b/tests/test_docs.py @@ -58,6 +58,4 @@ def test_links(doc: str) -> None: def test_rfc_links(doc: str) -> None: data = get_file(doc) match = rx_datatracker_ietf.search(data) - assert ( - not match - ), f"{match.group(0)} link used. Must be https://www.rfc-editor.org/rfc/{match.group(1)}.html" + assert not match, f"{match.group(0)} link used. Must be https://www.rfc-editor.org/rfc/{match.group(1)}.html"