From f0969f08e6cc140065d7edfc9583333172642785 Mon Sep 17 00:00:00 2001 From: Mateusz Jakub Fila Date: Sat, 28 Sep 2024 18:25:33 +0200 Subject: [PATCH 1/2] replace black with ruff --- .pre-commit-config.yaml | 9 ++++++--- .ruff.toml | 10 ++++++++++ pyproject.toml | 3 --- 3 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 .ruff.toml delete mode 100644 pyproject.toml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d2d44d7b..709cb344 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,7 +23,10 @@ repos: "-x", ".github/*", ".pre-commit-config.yaml", "README.md", "doc/ReleaseNotes.md", ".k4fwcore-ci.d/*", "-f"] - - repo: https://github.com/psf/black - rev: 23.11.0 + - repo: local hooks: - - id: black + - id: ruff-format + name: ruff-format + entry: ruff format --force-exclude + types: [python] + language: system diff --git a/.ruff.toml b/.ruff.toml new file mode 100644 index 00000000..5ac82934 --- /dev/null +++ b/.ruff.toml @@ -0,0 +1,10 @@ +target-version = "py311" + +line-length = 99 + +[format] +# Make things format the same way as black +quote-style = "double" +indent-style = "space" +skip-magic-trailing-comma = false +line-ending = "auto" diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index 466e9b9c..00000000 --- a/pyproject.toml +++ /dev/null @@ -1,3 +0,0 @@ -[tool.black] -line-length = 99 -target-version = ["py310"] From 7ec8d2bcc96f8bdd7730c7403300ac3b4ff8f386 Mon Sep 17 00:00:00 2001 From: Mateusz Jakub Fila Date: Wed, 2 Oct 2024 09:20:30 +0200 Subject: [PATCH 2/2] apply format --- k4FWCore/scripts/k4-print-joboptions | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/k4FWCore/scripts/k4-print-joboptions b/k4FWCore/scripts/k4-print-joboptions index 6aeb07a9..8e104863 100755 --- a/k4FWCore/scripts/k4-print-joboptions +++ b/k4FWCore/scripts/k4-print-joboptions @@ -1,8 +1,5 @@ #!/usr/bin/env python -""" - - -""" +""" """ from __future__ import print_function import argparse