From f126925ea9a4cd66b28b2d2ed8ab2b83f6492c3a Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Thu, 26 Oct 2023 12:12:51 -0400 Subject: [PATCH 1/2] chore: move to using Ruff formatter Signed-off-by: Henry Schreiner --- .pre-commit-config.yaml | 9 +++------ notebooks/HistLogo.ipynb | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e846c82c..b781cb94 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 @@ -34,6 +29,8 @@ repos: - 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/notebooks/HistLogo.ipynb b/notebooks/HistLogo.ipynb index 487c970e..76e93a81 100644 --- a/notebooks/HistLogo.ipynb +++ b/notebooks/HistLogo.ipynb @@ -114,7 +114,7 @@ ], "source": [ "h2 = h[::10j, ::10j]\n", - "h2.plot();" + "h2.plot()" ] }, { From 5960222f34411cff85d84884253264fbb472f80b Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Fri, 17 Nov 2023 14:24:58 -0500 Subject: [PATCH 2/2] chore: use ruff format Signed-off-by: Henry Schreiner --- .pre-commit-config.yaml | 2 +- README.md | 3 --- docs/index.rst | 4 +--- notebooks/HistLogo.ipynb | 2 +- pyproject.toml | 4 +--- 5 files changed, 4 insertions(+), 11 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b781cb94..8611ec3b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ 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"] 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/notebooks/HistLogo.ipynb b/notebooks/HistLogo.ipynb index 76e93a81..487c970e 100644 --- a/notebooks/HistLogo.ipynb +++ b/notebooks/HistLogo.ipynb @@ -114,7 +114,7 @@ ], "source": [ "h2 = h[::10j, ::10j]\n", - "h2.plot()" + "h2.plot();" ] }, { 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