From cebeff717cdb458809ae5a315575535b8ff27de3 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Tue, 4 Jun 2024 04:23:28 -0400 Subject: [PATCH] chore: udpate ruff config and format (#169) * chore: udpate ruff config and format Signed-off-by: Henry Schreiner * chore: some updates to GH Signed-off-by: Henry Schreiner * Apply suggestions from code review --------- Signed-off-by: Henry Schreiner --- .github/workflows/ci.yml | 4 ++++ .pre-commit-config.yaml | 6 +----- README.md | 3 --- pyproject.toml | 12 +++++------- 4 files changed, 10 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cbb47fa..db38189 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,10 @@ on: types: - published +concurrency: + group: ${ github.workflow }-${ github.ref } + cancel-in-progress: true + jobs: pre-commit: name: Format diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e7abaac..a4db933 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,9 +1,4 @@ repos: -- repo: https://github.com/psf/black-pre-commit-mirror - rev: 24.4.2 - hooks: - - id: black - - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.6.0 hooks: @@ -23,6 +18,7 @@ repos: hooks: - id: ruff args: ["--fix", "--show-fixes"] + - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy rev: v1.10.0 diff --git a/README.md b/README.md index 123cc61..eebb0a1 100644 --- a/README.md +++ b/README.md @@ -170,14 +170,11 @@ uproot-browser tree ../scikit-hep-testdata/src/skhep_testdata/data/uproot-Event. ## Development [![pre-commit.ci status][pre-commit-badge]][pre-commit-link] -[![Code style: black][black-badge]][black-link] See [CONTRIBUTING.md](https://github.com/scikit-hep/uproot-browser/blob/main/.github/CONTRIBUTING.md) for details on how to set up a development environment. [actions-badge]: https://github.com/scikit-hep/uproot-browser/workflows/CI/badge.svg [actions-link]: https://github.com/scikit-hep/uproot-browser/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/uproot-browser [conda-link]: https://github.com/conda-forge/uproot-browser-feedstock [github-discussions-badge]: https://img.shields.io/static/v1?label=Discussions&message=Ask&color=blue&logo=github diff --git a/pyproject.toml b/pyproject.toml index 10a141b..bba49b7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -130,8 +130,10 @@ messages_control.disable = [ ] [tool.ruff] -select = [ - "E", "F", "W", # flake8 +src = ["src"] + +[tool.ruff.lint] +extend-select = [ "B", # flake8-bugbear "I", # isort "ARG", # flake8-unused-arguments @@ -157,16 +159,12 @@ ignore = [ "RUF001", # Unicode chars "PLR", ] -src = ["src"] typing-modules = ["uproot_browser._compat.typing"] unfixable = [ - "T20", # Removes print statements - "F841", # Removes unused variables "SIM118", # Dict .keys() removal (uproot) ] -exclude = [] -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] "noxfile.py" = ["T20"] "tests/*" = ["T20"] "src/uproot_browser/tree.py" = ["UP006"]