Skip to content

Commit 1957361

Browse files
committed
add pre-commit install options
1 parent ec966e4 commit 1957361

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

docs/posts/2021/2021-01-04-python-lint-and-format.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -592,8 +592,14 @@ exclude = [
592592
593593
```bash
594594
pip install pre-commit
595+
596+
# pre-commit install by default installs pre-commit hook only:
595597
pre-commit install
596598
599+
# add --hook-type to add other git hook types:
600+
pre-commit install --hook-type pre-push
601+
602+
597603
## install the script along with the hook environments in one command
598604
599605
## https://pre-commit.com/index.html#pre-commit-install-hooks
@@ -696,16 +702,16 @@ repos:
696702
- id: python-use-type-annotations
697703
- repo: local
698704
hooks:
699-
- id: ruff-check
700-
name: ruff-check
701-
entry: ruff check --force-exclude
705+
- id: ruff-format
706+
name: ruff-format
707+
entry: ruff format --force-exclude
702708
language: system
703709
types_or: [python, pyi, jupyter]
704710
args: []
705711
require_serial: true
706-
- id: ruff-format
707-
name: ruff-format
708-
entry: ruff format --force-exclude
712+
- id: ruff-check
713+
name: ruff-check
714+
entry: ruff check --force-exclude
709715
language: system
710716
types_or: [python, pyi, jupyter]
711717
args: []

0 commit comments

Comments
 (0)