Skip to content

Commit 7ef0e33

Browse files
authored
add .pre-commit.config.yaml for black, ruff, and pytest (Netflix#3162)
* add .pre-commit-config.yaml file * add pre-commit dep, update deps * fix yaml format and update ruff version, remove args * use latest python version
1 parent c0d21c1 commit 7ef0e33

File tree

3 files changed

+59
-1
lines changed

3 files changed

+59
-1
lines changed

.pre-commit-config.yaml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Quick Start:
2+
#
3+
# pip install pre-commit
4+
# pre-commit install && pre-commit install -t pre-push
5+
# pre-commit run --all-files
6+
#
7+
# To Skip Checks:
8+
#
9+
# git commit --no-verify
10+
fail_fast: false
11+
12+
default_language_version:
13+
python: python3.11.2
14+
15+
repos:
16+
# Black
17+
- repo: https://github.com/psf/black
18+
rev: 23.1.0
19+
hooks:
20+
- id: black
21+
22+
# Ruff
23+
- repo: https://github.com/charliermarsh/ruff-pre-commit
24+
rev: "v0.0.259"
25+
hooks:
26+
- id: ruff
27+
28+
# Pytest
29+
- repo: local
30+
hooks:
31+
- id: tests
32+
name: run tests
33+
entry: pytest -v
34+
language: system
35+
types: [python]
36+
stages: [push]

requirements-dev.in

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ devtools
66
factory-boy
77
faker
88
ipython
9+
pre-commit
910
pytest
1011
ruff
1112
vulture

requirements-dev.txt

+22-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ backcall==0.2.0
1818
# via ipython
1919
black==23.1.0
2020
# via -r requirements-dev.in
21+
cfgv==3.3.1
22+
# via pre-commit
2123
click==8.1.3
2224
# via
2325
# -r requirements-dev.in
@@ -28,6 +30,8 @@ decorator==5.1.1
2830
# via ipython
2931
devtools==0.10.0
3032
# via -r requirements-dev.in
33+
distlib==0.3.6
34+
# via virtualenv
3135
executing==1.2.0
3236
# via
3337
# devtools
@@ -38,6 +42,10 @@ faker==18.3.1
3842
# via
3943
# -r requirements-dev.in
4044
# factory-boy
45+
filelock==3.10.4
46+
# via virtualenv
47+
identify==2.5.22
48+
# via pre-commit
4149
iniconfig==2.0.0
4250
# via pytest
4351
ipython==8.11.0
@@ -48,6 +56,8 @@ matplotlib-inline==0.1.6
4856
# via ipython
4957
mypy-extensions==1.0.0
5058
# via black
59+
nodeenv==1.7.0
60+
# via pre-commit
5161
packaging==23.0
5262
# via
5363
# black
@@ -61,9 +71,13 @@ pexpect==4.8.0
6171
pickleshare==0.7.5
6272
# via ipython
6373
platformdirs==3.1.1
64-
# via black
74+
# via
75+
# black
76+
# virtualenv
6577
pluggy==1.0.0
6678
# via pytest
79+
pre-commit==3.2.0
80+
# via -r requirements-dev.in
6781
prompt-toolkit==3.0.38
6882
# via ipython
6983
ptyprocess==0.7.0
@@ -76,6 +90,8 @@ pytest==7.2.2
7690
# via -r requirements-dev.in
7791
python-dateutil==2.8.2
7892
# via faker
93+
pyyaml==6.0
94+
# via pre-commit
7995
ruff==0.0.259
8096
# via -r requirements-dev.in
8197
six==1.16.0
@@ -90,7 +106,12 @@ traitlets==5.9.0
90106
# via
91107
# ipython
92108
# matplotlib-inline
109+
virtualenv==20.21.0
110+
# via pre-commit
93111
vulture==2.7
94112
# via -r requirements-dev.in
95113
wcwidth==0.2.6
96114
# via prompt-toolkit
115+
116+
# The following packages are considered to be unsafe in a requirements file:
117+
# setuptools

0 commit comments

Comments
 (0)