mirror of
https://github.com/FuQuan233/nonebot-plugin-llmchat.git
synced 2025-09-07 03:50:47 +00:00
commit
9e478272cb
4 changed files with 104 additions and 0 deletions
23
.github/actions/setup-python/action.yml
vendored
Normal file
23
.github/actions/setup-python/action.yml
vendored
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
name: Setup Python
|
||||||
|
description: Setup Python
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
python-version:
|
||||||
|
description: Python version
|
||||||
|
required: false
|
||||||
|
default: "3.9"
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Install poetry
|
||||||
|
run: pipx install poetry
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: ${{ inputs.python-version }}
|
||||||
|
cache: "poetry"
|
||||||
|
|
||||||
|
- run: poetry install --all-extras
|
||||||
|
shell: bash
|
33
.github/workflows/pyright.yml
vendored
Normal file
33
.github/workflows/pyright.yml
vendored
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
name: Pyright Lint
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- "nonebot_plugin_llmchat/**"
|
||||||
|
- ".github/workflows/pyright.yml"
|
||||||
|
- "pyproject.toml"
|
||||||
|
- "poetry.lock"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
pyright:
|
||||||
|
name: Pyright Lint
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
concurrency:
|
||||||
|
group: lint-${{ github.ref }}-${{ matrix.env }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Python environment
|
||||||
|
uses: ./.github/actions/setup-python
|
||||||
|
|
||||||
|
- run: echo "$(poetry env info --path)/bin" >> $GITHUB_PATH
|
||||||
|
|
||||||
|
- name: Run Pyright
|
||||||
|
uses: jakebailey/pyright-action@v2
|
||||||
|
with:
|
||||||
|
pylance-version: latest-release
|
26
.github/workflows/ruff.yml
vendored
Normal file
26
.github/workflows/ruff.yml
vendored
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
name: Ruff Lint
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- "nonebot_plugin_llmchat/**"
|
||||||
|
- ".github/workflows/ruff.yml"
|
||||||
|
- "pyproject.toml"
|
||||||
|
- "poetry.lock"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ruff:
|
||||||
|
name: Ruff Lint
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
concurrency:
|
||||||
|
group: lint-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Run Ruff Lint
|
||||||
|
uses: astral-sh/ruff-action@v3
|
22
.pre-commit-config.yaml
Normal file
22
.pre-commit-config.yaml
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
default_install_hook_types: [pre-commit, prepare-commit-msg]
|
||||||
|
ci:
|
||||||
|
autofix_commit_msg: ":rotating_light: auto fix by pre-commit hooks"
|
||||||
|
autofix_prs: true
|
||||||
|
autoupdate_branch: main
|
||||||
|
autoupdate_schedule: monthly
|
||||||
|
autoupdate_commit_msg: ":arrow_up: auto update by pre-commit hooks"
|
||||||
|
repos:
|
||||||
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||||
|
rev: v0.9.4
|
||||||
|
hooks:
|
||||||
|
- id: ruff
|
||||||
|
args: [--fix]
|
||||||
|
stages: [pre-commit]
|
||||||
|
- id: ruff-format
|
||||||
|
stages: [pre-commit]
|
||||||
|
|
||||||
|
- repo: https://github.com/nonebot/nonemoji
|
||||||
|
rev: v0.1.4
|
||||||
|
hooks:
|
||||||
|
- id: nonemoji
|
||||||
|
stages: [prepare-commit-msg]
|
Loading…
Add table
Add a link
Reference in a new issue