Skip to content

Add isort via pre-commit #2988

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 22 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
---
# black complains loudly that fio-histo-log-pctile.py is not a python file,
# which it isn't, so ignore it.
exclude: (agent/bench-scripts/test-bin/fio-histo-log-pctiles.py)
# `black` complains loudly that fio-histo-log-pctile.py is not a python file,
# which it isn't, and also complains about the long forgotten demo.py file, so
# we ignore them both.
#
# We must duplicate these excludes also listed in pyproject.toml because the
# commands below are explicitly invoked on the files added or changed. This
# exclude prevents those checks being run.
exclude: (agent/bench-scripts/test-bin/fio-histo-log-pctiles\.py|web-server/v0\.3/demo\.py)
repos:
- repo: https://gitlab.com/pycqa/flake8
rev: 4.0.1
hooks:
- id: flake8
- id: flake8
name: flake8 (python3)
language_version: python3
- repo: https://github.com/python/black.git
rev: 22.3.0
hooks:
- id: black
language_version: python3
args: ["--check"]
- id: black
name: black (python3)
language_version: python3
args: ["--check"]
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
name: isort (python3)
language_version: python3
args: ["--check"]
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ known_first_party = ["pbench"] # separate "pbench" section
multi_line_output = 3 # "hanging" indent with dedented paren
force_sort_within_sections = true # don't separate import vs from
order_by_type = false # sort alphabetic regardless of case
skip = ["fio-histo-log-pctiles.py", "web-server/v0.3/demo.py"] # like black
extend_skip = ["fio-histo-log-pctiles.py", "web-server/v0.3/demo.py"] # like black

[tool.black]
skip-string-normalization = false
Expand Down