Abinaya Mahendiran commited on
Commit
47bf39a
1 Parent(s): 0675773

Added pre-commit hooks

Browse files
Files changed (3) hide show
  1. .flake8 +8 -0
  2. .pre-commit-config.yaml +28 -0
  3. pyproject.toml +31 -0
.flake8 ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ [flake8]
2
+ exclude = venv
3
+ ignore = E501, W503, E226, E203
4
+ max-line-length = 85
5
+
6
+ # E501: Line too long
7
+ # W503: Line break occurred before binary operator
8
+ # E226: Missing white space around arithmetic operator
.pre-commit-config.yaml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # See https://pre-commit.com for more information
2
+ # See https://pre-commit.com/hooks.html for more hooks
3
+ repos:
4
+ - repo: https://github.com/pre-commit/pre-commit-hooks
5
+ rev: v3.4.0
6
+ hooks:
7
+ - id: trailing-whitespace
8
+ - id: check-yaml
9
+ - id: check-ast
10
+ - id: check-json
11
+ - id: check-merge-conflict
12
+ - id: detect-private-key
13
+ - repo: https://github.com/psf/black
14
+ rev: 21.6b0
15
+ hooks:
16
+ - id: black
17
+ args: []
18
+ files: .
19
+ - repo: https://gitlab.com/PyCQA/flake8
20
+ rev: 3.9.2
21
+ hooks:
22
+ - id: flake8
23
+ - repo: https://github.com/PyCQA/isort
24
+ rev: 5.9.1
25
+ hooks:
26
+ - id: isort
27
+ args: []
28
+ files: .
pyproject.toml ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Black formatting
2
+ [tool.black]
3
+ line-length = 85
4
+ include = '\.pyi?$'
5
+ exclude = '''
6
+ /(
7
+ \.eggs # exclude a few common directories in the
8
+ | \.git # root of the project
9
+ | \.hg
10
+ | \.mypy_cache
11
+ | \.tox
12
+ | \.venv
13
+ | _build
14
+ | buck-out
15
+ | build
16
+ | dist
17
+ | wandb
18
+ | model
19
+ | dataset
20
+ | notebook
21
+ )/
22
+ '''
23
+
24
+ # iSort
25
+ [tool.isort]
26
+ profile = "black"
27
+ line_length = 85
28
+ multi_line_output = 3
29
+ include_trailing_comma = true
30
+ skip_gitignore = true
31
+ virtual_env = "venv"