Skip to content

Commit

Permalink
chore: move to using Ruff formatter (#544)
Browse files Browse the repository at this point in the history
See scientific-python/cookie#299. Waiting on
astral-sh/ruff#8254.

---------

Signed-off-by: Henry Schreiner <[email protected]>
  • Loading branch information
henryiii authored Nov 17, 2023
1 parent 51dd7d4 commit 789072d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 16 deletions.
11 changes: 4 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 789072d

Please sign in to comment.