Skip to content

Commit 097943d

Browse files
committed
chore: add pre-commit and re-format all files
1 parent 17a488f commit 097943d

File tree

2 files changed

+90
-0
lines changed

2 files changed

+90
-0
lines changed

.eslintrc

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"parserOptions": {
3+
"ecmaVersion": "latest",
4+
"sourceType": "module"
5+
},
6+
7+
"env": {
8+
"es6": true
9+
}
10+
}

.pre-commit-config.yaml

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
exclude: "node_modules|.git"
2+
default_stages: [commit]
3+
fail_fast: false
4+
5+
repos:
6+
- repo: https://github.com/pre-commit/pre-commit-hooks
7+
rev: v4.5.0
8+
hooks:
9+
- id: end-of-file-fixer
10+
- id: trailing-whitespace
11+
files: '^next_crm/.*\.py'
12+
exclude: ".*json$|.*txt$|.*csv|.*md|.*svg"
13+
- id: check-yaml
14+
- id: check-merge-conflict
15+
- id: check-ast
16+
- id: check-json
17+
- id: check-toml
18+
- id: check-yaml
19+
- id: debug-statements
20+
files: '^next_crm/.*\.py'
21+
22+
- repo: https://github.com/asottile/pyupgrade
23+
rev: v3.15.0
24+
hooks:
25+
- id: pyupgrade
26+
args: ["--py310-plus"]
27+
28+
- repo: https://github.com/psf/black
29+
rev: 24.2.0
30+
hooks:
31+
- id: black
32+
files: '^next_crm/.*\.py'
33+
34+
- repo: https://github.com/pre-commit/mirrors-prettier
35+
rev: v3.1.0
36+
hooks:
37+
- id: prettier
38+
files: '^next_crm/.*\.js|jsx|ts|tsx'
39+
# Ignore any files that might contain jinja / bundles
40+
exclude: |
41+
(?x)^(
42+
next_crm/public/dist/.*|
43+
.*node_modules.*|
44+
.*boilerplate.*|
45+
next_crm/www/website_script.js|
46+
next_crm/templates/includes/.*|
47+
next_crm/public/js/lib/.*|
48+
next_crm/website/doctype/website_theme/website_theme_template.scss
49+
)$
50+
51+
- repo: https://github.com/pre-commit/mirrors-eslint
52+
rev: v8.56.0
53+
hooks:
54+
- id: eslint
55+
files: '^next_crm/.*\.js|jsx|ts|tsx'
56+
args: ["--quiet"]
57+
# Ignore any files that might contain jinja / bundles
58+
exclude: |
59+
(?x)^(
60+
next_crm/public/dist/.*|
61+
cypress/.*|
62+
.*node_modules.*|
63+
.*boilerplate.*|
64+
next_crm/www/website_script.js|
65+
next_crm/templates/includes/.*|
66+
next_crm/public/js/lib/.*
67+
)$
68+
69+
- repo: https://github.com/PyCQA/isort
70+
rev: 5.13.2
71+
hooks:
72+
- id: isort
73+
args: ["--profile", "black"]
74+
files: '^next_crm/.*\.py'
75+
76+
- repo: https://github.com/PyCQA/flake8
77+
rev: 7.0.0
78+
hooks:
79+
- id: flake8
80+
additional_dependencies: ["flake8-isort", "flake8-bugbear"]

0 commit comments

Comments
 (0)