Skip to content

Commit 857348a

Browse files
add precommit_example
1 parent 060bcc6 commit 857348a

File tree

4 files changed

+59
-0
lines changed

4 files changed

+59
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[flake8]
2+
ignore = E203, E266, E501, W503, F403, F401
3+
max-line-length = 79
4+
max-complexity = 18
5+
select = B,C,E,F,W,T4,B9
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
repos:
2+
- repo: https://github.com/ambv/black
3+
rev: 20.8b1
4+
hooks:
5+
- id: black
6+
- repo: https://gitlab.com/pycqa/flake8
7+
rev: 3.8.4
8+
hooks:
9+
- id: flake8
10+
- repo: https://github.com/timothycrosley/isort
11+
rev: 5.7.0
12+
hooks:
13+
- id: isort
14+
- repo: https://github.com/kynan/nbstripout
15+
rev: 0.5.0
16+
hooks:
17+
- id: nbstripout
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
all: install_format_packages download_config add_precommit install_git_hooks
2+
install_format_packages:
3+
pip install flake8
4+
pip install isort
5+
pip install black
6+
pip install nbstripout
7+
pip install pre-commit
8+
9+
download_config:
10+
wget https://gist.githubusercontent.com/khuyentran1401/f4a4c822320a9db266ad935b501be66e/raw/3ebf2b029490a970591caa733dd9d2e9767b184e/.flake8
11+
wget https://gist.githubusercontent.com/khuyentran1401/2d6fc241f6738fdc0946e62e1597223e/raw/621d516dfc010d94ccdb8773d889f3173c996fb0/.pre-commit-config.yaml
12+
13+
add_precommit:
14+
wget -O precommit https://gist.githubusercontent.com/khuyentran1401/b86812c900110c5cf4450e183669ae48/raw/55041856a74a27245f4273040516690c856a3f0a/pyproject.toml
15+
touch pyproject.toml
16+
cat precommit >> pyproject.toml
17+
rm precommit
18+
19+
install_git_hooks:
20+
pre-commit install
21+
22+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[tool.black]
2+
line-length = 79
3+
include = '\.pyi?$'
4+
exclude = '''
5+
/(
6+
\.git
7+
| \.hg
8+
| \.mypy_cache
9+
| \.tox
10+
| \.venv
11+
| _build
12+
| buck-out
13+
| build
14+
)/
15+
'''

0 commit comments

Comments
 (0)