Skip to content

chore: 使用 Ruff 替代 Black 作为格式化工具 #108

chore: 使用 Ruff 替代 Black 作为格式化工具

chore: 使用 Ruff 替代 Black 作为格式化工具 #108

Workflow file for this run

name: Lint
on:
push:
branches:
- master
paths:
- "**.py"
pull_request:
paths:
- "**.py"
workflow_dispatch:
jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pdm-project/setup-pdm@v3
name: Setup PDM
with:
python-version: 3.9
cache: true
- name: Install dependencies
run: pdm install -G dev -G lint
- run: |
eval $(pdm venv activate)
ruff check --output-format=github .
ruff format --check .
pylint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pdm-project/setup-pdm@v3
name: Setup PDM
with:
python-version: 3.9
cache: true
- name: Install dependencies
run: pdm install -G dev -G lint
- run: |
eval $(pdm venv activate)
pylint alicebot packages/*
pyright:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pdm-project/setup-pdm@v3
name: Setup PDM
with:
python-version: 3.9
cache: true
- name: Install dependencies
run: pdm install -G dev -G lint -G typing -G test
- uses: pnpm/action-setup@v2
with:
version: ^6.10.0
- uses: actions/setup-node@v3
with:
node-version: "16"
cache: "pnpm"
- run: pnpm install
shell: bash
- run: |
eval $(pdm venv activate)
pnpm run pyright
mypy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pdm-project/setup-pdm@v3
name: Setup PDM
with:
python-version: 3.9
cache: true
- name: Install dependencies
run: pdm install -G dev -G lint -G typing -G test
- run: |
eval $(pdm venv activate)
mypy .