Skip to content

Commit

Permalink
fix: ci ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
nannan00 committed Nov 15, 2023
1 parent c378254 commit 6964fb6
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/bk-login.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ jobs:
- name: Format & Lint with ruff
run: |
pip install ruff==0.1.4
ruff format src/bk-login --config=src/bk-login/pyproject.toml
ruff src/bk-login --config=src/bk-login/pyproject.toml
ruff format src/bk-login --config=src/bk-login/pyproject.toml --no-cache
ruff src/bk-login --config=src/bk-login/pyproject.toml --no-cache
- name: Lint with mypy
run: |
pip install mypy==1.6.1 types-requests==2.31.0.2 types-setuptools==57.4.18 types-dataclasses==0.1.7 types-redis==3.5.18 types-PyMySQL==1.1.0.1 types-six==0.1.9 types-toml==0.1.5 types-pytz==2023.3.0.0 types-urllib3==1.26.25.14
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/bk-user.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ jobs:
- name: Format & Lint with ruff
run: |
pip install ruff==0.1.4
ruff format src/bk-user --config=src/bk-user/pyproject.toml
ruff src/bk-user --config=src/bk-user/pyproject.toml
ruff format src/bk-user --config=src/bk-user/pyproject.toml --no-cache
ruff src/bk-user --config=src/bk-user/pyproject.toml --no-cache
- name: Lint with mypy
run: |
pip install mypy==1.6.1 types-requests==2.31.0.2 types-setuptools==57.4.18 types-dataclasses==0.1.7 types-redis==3.5.18 types-PyMySQL==1.1.0.1 types-six==0.1.9 types-toml==0.1.5 types-pytz==2023.3.0.0 types-urllib3==1.26.25.14
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/idp-plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
- name: Format & Lint with ruff
run: |
pip install ruff==0.1.4
ruff format src/idp-plugins --config=src/idp-plugins/pyproject.toml
ruff src/idp-plugins --config=src/idp-plugins/pyproject.toml
ruff format src/idp-plugins --config=src/idp-plugins/pyproject.toml --no-cache
ruff src/idp-plugins --config=src/idp-plugins/pyproject.toml --no-cache
- name: Lint with mypy
run: |
pip install mypy==1.6.1 types-requests==2.31.0.2 types-setuptools==57.4.18 types-dataclasses==0.1.7 types-redis==3.5.18 types-PyMySQL==1.1.0.1 types-six==0.1.9 types-toml==0.1.5 types-pytz==2023.3.0.0 types-urllib3==1.26.25.14
Expand Down
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ repos:
name: ruff-formatter
language: python
types: [python]
entry: ruff format --config=src/bk-user/pyproject.toml --force-exclude
entry: ruff format --config=src/bk-user/pyproject.toml --no-cache
files: src/bk-user/
- id: ruff
name: ruff
language: python
types: [python]
entry: ruff --config=src/bk-user/pyproject.toml --force-exclude --fix
entry: ruff --config=src/bk-user/pyproject.toml --fix --no-cache
files: src/bk-user/
- id: mypy
name: mypy
Expand All @@ -80,13 +80,13 @@ repos:
name: ruff-formatter
language: python
types: [python]
entry: ruff format --config=src/bk-login/pyproject.toml --force-exclude
entry: ruff format --config=src/bk-login/pyproject.toml --no-cache
files: src/bk-login/
- id: ruff
name: ruff
language: python
types: [python]
entry: ruff --config=src/bk-login/pyproject.toml --force-exclude --fix
entry: ruff --config=src/bk-login/pyproject.toml --fix --no-cache
files: src/bk-login/
- id: mypy
name: mypy
Expand All @@ -105,13 +105,13 @@ repos:
name: ruff-formatter
language: python
types: [python]
entry: ruff format --config=src/bk-plugins/pyproject.toml --force-exclude
entry: ruff format --config=src/bk-plugins/pyproject.toml --no-cache
files: src/bk-plugins/
- id: ruff
name: ruff
language: python
types: [python]
entry: ruff --config=src/idp-plugins/pyproject.toml --force-exclude --fix
entry: ruff --config=src/idp-plugins/pyproject.toml --fix --no-cache
files: src/idp-plugins/
- id: mypy
name: mypy
Expand Down
1 change: 1 addition & 0 deletions src/bk-login/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ exclude = [
"venv",
"*/migrations/*",
]
force-exclude = true

[tool.ruff.mccabe]
# Unlike Flake8, default to a complexity level of 10.
Expand Down
4 changes: 3 additions & 1 deletion src/bk-user/bkuser/apis/web/idp/swagger.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
specific language governing permissions and limitations under the License.
"""
from typing import Dict

from drf_yasg import openapi
from bkuser.utils.pydantic import gen_openapi_schema

from bkuser.idp_plugins.base import list_plugin_cls
from bkuser.utils.pydantic import gen_openapi_schema


def get_idp_plugin_cfg_schema_map() -> Dict[str, openapi.Schema]:
Expand Down
2 changes: 1 addition & 1 deletion src/bk-user/bkuser/apis/web/idp/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from bkuser.apps.permission.constants import PermAction
from bkuser.apps.permission.permissions import perm_class
from bkuser.common.error_codes import error_codes
from .swagger import get_idp_plugin_cfg_schema_map

from .serializers import (
IdpCreateInputSLZ,
Expand All @@ -33,6 +32,7 @@
IdpSearchOutputSLZ,
IdpUpdateInputSLZ,
)
from .swagger import get_idp_plugin_cfg_schema_map


class IdpPluginListApi(generics.ListAPIView):
Expand Down
1 change: 1 addition & 0 deletions src/bk-user/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ exclude = [
"venv",
"*/migrations/*",
]
force-exclude = true

[tool.ruff.mccabe]
# Unlike Flake8, default to a complexity level of 10.
Expand Down
1 change: 1 addition & 0 deletions src/idp-plugins/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ exclude = [
"venv",
"*/migrations/*",
]
force-exclude = true

[tool.ruff.mccabe]
# Unlike Flake8, default to a complexity level of 10.
Expand Down

0 comments on commit 6964fb6

Please sign in to comment.