From 789072d0a1c4b9105a6a273ba6330f177e8b5f81 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Fri, 17 Nov 2023 14:40:06 -0500 Subject: [PATCH] chore: move to using Ruff formatter (#544) See https://github.com/scientific-python/cookie/pull/299. Waiting on https://github.com/astral-sh/ruff/issues/8254. --------- Signed-off-by: Henry Schreiner --- .pre-commit-config.yaml | 11 ++++------- README.md | 3 --- docs/index.rst | 4 +--- pyproject.toml | 4 +--- 4 files changed, 6 insertions(+), 16 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e846c82c..8611ec3b 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.7.0] + additional_dependencies: [black==23.*] - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.5.0 @@ -29,11 +24,13 @@ repos: - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.5 + rev: v0.1.6 hooks: - id: ruff args: ["--fix", "--show-fixes"] types_or: [python, pyi, jupyter] + - id: ruff-format + types_or: [python, pyi, jupyter] - repo: https://github.com/pre-commit/mirrors-mypy rev: v1.7.0 diff --git a/README.md b/README.md index 7d7a1a0f..c8ad6a17 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,6 @@ [![Actions Status][actions-badge]][actions-link] [![Documentation Status][rtd-badge]][rtd-link] [![pre-commit.ci status][pre-commit-badge]][pre-commit-link] -[![Code style: black][black-badge]][black-link] [![PyPI version][pypi-version]][pypi-link] [![Conda-Forge][conda-badge]][conda-link] @@ -182,8 +181,6 @@ Support for this work was provided by the National Science Foundation cooperativ [actions-link]: https://github.com/scikit-hep/hist/actions [binder-badge]: https://mybinder.org/badge_logo.svg [binder-link]: https://mybinder.org/v2/gh/scikit-hep/hist/HEAD -[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/hist [conda-link]: https://github.com/conda-forge/hist-feedstock [doi-badge]: https://zenodo.org/badge/239605861.svg diff --git a/docs/index.rst b/docs/index.rst index d91248b4..92876b82 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -6,7 +6,7 @@ Welcome to Hist's documentation! ================================ -|Actions Status| |Documentation Status| |pre-commit.ci Status| |Code style: black| |PyPI version| +|Actions Status| |Documentation Status| |pre-commit.ci Status| |PyPI version| |Conda-Forge| |PyPI platforms| |DOI| |License| |GitHub Discussion| |Gitter| |Binder| |Scikit-HEP| Introduction @@ -81,8 +81,6 @@ Indices and tables :target: https://hist.readthedocs.io/en/latest/?badge=latest .. |pre-commit.ci Status| image:: https://results.pre-commit.ci/badge/github/scikit-hep/hist/main.svg :target: https://results.pre-commit.ci/repo/github/scikit-hep/hist -.. |Code style: black| image:: https://img.shields.io/badge/code%20style-black-000000.svg - :target: https://github.com/psf/black .. |PyPI version| image:: https://badge.fury.io/py/hist.svg :target: https://pypi.org/project/hist/ .. |Conda-Forge| image:: https://img.shields.io/conda/vn/conda-forge/hist diff --git a/pyproject.toml b/pyproject.toml index a4512a9b..74716b21 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -132,7 +132,6 @@ warn_unused_configs = true files = "src" python_version = "3.8" strict = true -show_error_codes = true enable_error_code = ["ignore-without-code", "truthy-bool", "redundant-expr"] warn_unreachable = true @@ -208,9 +207,8 @@ extend-select = [ "UP", # pyupgrade "YTT", # flake8-2020 ] -ignore = ["PLR", "E501", "PT011", "PT013", "PT004", "B017"] +ignore = ["PLR", "E501", "PT011", "PT013", "PT004", "B017", "ISC001"] typing-modules = ["hist._compat.typing"] -unfixable = ["T20", "F841"] isort.required-imports = ["from __future__ import annotations"] flake8-unused-arguments.ignore-variadic-names = true