Skip to content

STYLE make black local hook run twice as fast #49947

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
Nov 29, 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
4 changes: 3 additions & 1 deletion .github/workflows/code-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ jobs:

- name: Run pre-commit
uses: pre-commit/[email protected]
with:
extra_args: --verbose --all-files
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

verbose just shows the timings for each hook. --all-files is the default extra_args


docstring_typing_pylint:
name: Docstring validation, typing, and pylint
Expand Down Expand Up @@ -93,7 +95,7 @@ jobs:
- name: Typing + pylint
uses: pre-commit/[email protected]
with:
extra_args: --hook-stage manual --all-files
extra_args: --verbose --hook-stage manual --all-files
if: ${{ steps.build.outcome == 'success' && always() }}

- name: Run docstring validation script tests
Expand Down
14 changes: 10 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ repos:
entry: python scripts/run_vulture.py
pass_filenames: true
require_serial: false
- repo: https://github.com/python/black
rev: 22.10.0
hooks:
- id: black
- repo: https://github.com/codespell-project/codespell
rev: v2.2.2
hooks:
Expand Down Expand Up @@ -114,6 +110,16 @@ repos:
additional_dependencies: *flake8_dependencies
- repo: local
hooks:
# NOTE: we make `black` a local hook because if it's installed from
# PyPI (rather than from source) then it'll run twice as fast thanks to mypyc
- id: black
name: black
description: "Black: The uncompromising Python code formatter"
entry: black
language: python
require_serial: true
types_or: [python, pyi]
additional_dependencies: [black==22.10.0]
- id: pyright
# note: assumes python env is setup and activated
name: pyright
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ dependencies:
- cxx-compiler

# code checks
- black=22.3.0
- black=22.10.0
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at some point I'll address #46561

- cpplint
- flake8=5.0.4
- flake8-bugbear=22.7.1 # used by flake8, find likely bugs
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ py
moto
flask
asv
black==22.3.0
black==22.10.0
cpplint
flake8==5.0.4
flake8-bugbear==22.7.1
Expand Down