Skip to content

Commit c08e962

Browse files
author
Xinkai Yi
committed
feat: 新增pre-commit规范检查工具 --story=130029401
1 parent 48bf0a7 commit c08e962

133 files changed

Lines changed: 1586 additions & 1379 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.flake8

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[flake8]
2+
ignore = F405, W503, E203
3+
per-file-ignores =
4+
*/__init__.py: F401
5+
exclude =
6+
*migrations*,
7+
# python related
8+
*.pyc,
9+
.git,
10+
__pycache__,
11+
*/node_modules/*
12+
./static/*
13+
./blueking/*
14+
*/blueking/*
15+
./blueapps/*
16+
*/blueapps/*
17+
./pipeline/*
18+
./sites/*
19+
./config/default.py
20+
./scripts_tools/*
21+
./support-files/*
22+
./upgrade.py
23+
./iam/*
24+
25+
26+
max-line-length=120
27+
max-complexity=26
28+
format=pylint
29+
show_source=False
30+
statistics=True
31+
count=True

.isort.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[settings]
2+
profile = black
3+
known_first_party = bk_plugin_framework,bk_plugin_runtime
4+
line_length = 120

.pre-commit-config.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
default_stages: [pre-commit]
2+
repos:
3+
- repo: https://github.com/asottile/pyupgrade
4+
rev: v3.21.2
5+
hooks:
6+
- id: pyupgrade
7+
8+
- repo: https://github.com/pre-commit/pre-commit-hooks
9+
rev: v6.0.0
10+
hooks:
11+
- id: check-merge-conflict
12+
13+
- repo: https://github.com/psf/black
14+
rev: 25.12.0
15+
hooks:
16+
- id: black
17+
language_version: python3.10
18+
args:
19+
- "--line-length=120"
20+
21+
- repo: https://github.com/pycqa/isort
22+
rev: 7.0.0
23+
hooks:
24+
- id: isort
25+
26+
- repo: https://github.com/pycqa/flake8
27+
rev: 7.3.0
28+
hooks:
29+
- id: flake8
30+
args:
31+
- "--config"
32+
- ".flake8"

bk-plugin-framework/bk_plugin/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
"""
32
Tencent is pleased to support the open source community by making 蓝鲸智云 - PaaS平台 (BlueKing - PaaS System) available.
43
Copyright (C) 2022 THL A29 Limited, a Tencent company. All rights reserved.

bk-plugin-framework/bk_plugin/versions/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
"""
32
Tencent is pleased to support the open source community by making 蓝鲸智云 - PaaS平台 (BlueKing - PaaS System) available.
43
Copyright (C) 2022 THL A29 Limited, a Tencent company. All rights reserved.

bk-plugin-framework/bk_plugin_framework/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
"""
32
Tencent is pleased to support the open source community by making 蓝鲸智云 - PaaS平台 (BlueKing - PaaS System) available.
43
Copyright (C) 2022 THL A29 Limited, a Tencent company. All rights reserved.

bk-plugin-framework/bk_plugin_framework/__version__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
"""
32
Tencent is pleased to support the open source community by making 蓝鲸智云 - PaaS平台 (BlueKing - PaaS System) available.
43
Copyright (C) 2022 THL A29 Limited, a Tencent company. All rights reserved.

bk-plugin-framework/bk_plugin_framework/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
"""
32
Tencent is pleased to support the open source community by making 蓝鲸智云 - PaaS平台 (BlueKing - PaaS System) available.
43
Copyright (C) 2022 THL A29 Limited, a Tencent company. All rights reserved.
@@ -9,6 +8,7 @@
98
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
109
specific language governing permissions and limitations under the License.
1110
"""
11+
1212
from enum import Enum
1313

1414

bk-plugin-framework/bk_plugin_framework/envs.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
"""
32
Tencent is pleased to support the open source community by making 蓝鲸智云 - PaaS平台 (BlueKing - PaaS System) available.
43
Copyright (C) 2022 THL A29 Limited, a Tencent company. All rights reserved.
@@ -9,15 +8,17 @@
98
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
109
specific language governing permissions and limitations under the License.
1110
"""
12-
import os
11+
1312
import base64
1413
import hashlib
1514
import logging
15+
import os
1616

1717
try:
1818
from pydantic.v1 import BaseSettings
1919
except ImportError:
2020
from pydantic import BaseSettings
21+
2122
from django.conf import settings as default_settings
2223

2324
logger = logging.getLogger("bk_plugin")

bk-plugin-framework/bk_plugin_framework/hub/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
"""
32
Tencent is pleased to support the open source community by making 蓝鲸智云 - PaaS平台 (BlueKing - PaaS System) available.
43
Copyright (C) 2022 THL A29 Limited, a Tencent company. All rights reserved.
@@ -10,9 +9,10 @@
109
specific language governing permissions and limitations under the License.
1110
"""
1211

12+
import logging
1313
import os
1414
import typing
15-
import logging
15+
1616
from bk_plugin_framework.utils.module_load import load_form_module_path
1717

1818
logger = logging.getLogger("bk-plugin-framework")

0 commit comments

Comments
 (0)