From 40d5ed5e244b9a257c05f0c1bc5a6cb8afef75ef Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Fri, 17 Nov 2023 14:27:26 -0500 Subject: [PATCH] chore: move to Ruff formatter (#895) * chore: move to Ruff formatter Signed-off-by: Henry Schreiner * style: pre-commit fixes * chore: update to working version of ruff-formatter Signed-off-by: Henry Schreiner --------- Signed-off-by: Henry Schreiner Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 13 +++++-------- README.md | 3 --- docs/index.rst | 4 +--- pyproject.toml | 3 ++- 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 675b8492..dd0c88b9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,16 +3,11 @@ ci: autofix_commit_msg: "style: pre-commit fixes" repos: - - repo: https://github.com/psf/black-pre-commit-mirror - rev: 23.11.0 - hooks: - - id: black-jupyter - - repo: https://github.com/adamchainz/blacken-docs rev: "1.16.0" hooks: - id: blacken-docs - additional_dependencies: [black==23.11.0] + additional_dependencies: [black==23.*] - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.5.0 @@ -52,10 +47,12 @@ repos: ] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.1.5" + rev: "v0.1.6" hooks: - id: ruff args: ["--fix", "--show-fixes"] + - id: ruff-format + types_or: [python, pyi, jupyter] - repo: https://github.com/pre-commit/mirrors-mypy rev: v1.7.0 @@ -86,7 +83,7 @@ repos: exclude: .pre-commit-config.yaml - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v17.0.4 + rev: v17.0.5 hooks: - id: clang-format types_or: [c++] diff --git a/README.md b/README.md index 32097096..e0502dd3 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,6 @@ [![Actions Status][actions-badge]][actions-link] [![Documentation Status][rtd-badge]][rtd-link] -[![Code style: black][black-badge]][black-link] [![PyPI version][pypi-version]][pypi-link] [![Conda-Forge][conda-badge]][conda-link] @@ -290,8 +289,6 @@ Support for this work was provided by the National Science Foundation cooperativ [actions-badge]: https://github.com/scikit-hep/boost-histogram/workflows/Tests/badge.svg [actions-link]: https://github.com/scikit-hep/boost-histogram/actions -[black-badge]: https://img.shields.io/badge/code%20style-black-000000.svg -[black-link]: https://github.com/psf/black [conda-badge]: https://img.shields.io/conda/vn/conda-forge/boost-histogram [conda-link]: https://github.com/conda-forge/boost-histogram-feedstock [github-discussions-badge]: https://img.shields.io/static/v1?label=Discussions&message=Ask&color=blue&logo=github diff --git a/docs/index.rst b/docs/index.rst index d848655c..d947b98e 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -11,7 +11,7 @@ Welcome to boost-histogram's documentation! =========================================== -|Actions Status| |Documentation Status| |Code style: black| |PyPI version| |Conda-Forge| +|Actions Status| |Documentation Status| |PyPI version| |Conda-Forge| |PyPI platforms| |DOI| |GitHub Discussion| |Gitter| |Scikit-HEP| Boost-histogram (`source `__) is @@ -116,8 +116,6 @@ Indices and tables :target: https://github.com/scikit-hep/boost-histogram/actions .. |Documentation Status| image:: https://readthedocs.org/projects/boost-histogram/badge/?version=latest :target: https://boost-histogram.readthedocs.io/en/latest/?badge=latest -.. |Code style: black| image:: https://img.shields.io/badge/code%20style-black-000000.svg - :target: https://github.com/ambv/black .. |PyPI version| image:: https://badge.fury.io/py/boost-histogram.svg :target: https://pypi.org/project/boost-histogram .. |Conda-Forge| image:: https://img.shields.io/conda/vn/conda-forge/boost-histogram diff --git a/pyproject.toml b/pyproject.toml index 34bc9ed1..b549b2aa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -148,7 +148,8 @@ extend-select = [ ignore = [ "PLR", # Design related pylint codes "E501", # Line too long - "PT011", "PT013" + "PT011", "PT013", # Incorrect pytest codes + "ISC001", # Conflicts with the formatter ] unfixable = [ "T20", # Removes print statements