Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"ghcr.io/devcontainers-extra/features/pdm:2": {},
"ghcr.io/meaningful-ooo/devcontainer-features/fish:2": {}
},
"postCreateCommand": "pdm config venv.in_project true && pdm config venv.with_pip true && pdm sync && pdm run pre-commit install && pdm run compile && yarn install",
"postCreateCommand": "pdm config venv.in_project true && pdm config venv.with_pip true && pdm sync && pdm run prek install && pdm run compile && yarn install",
"customizations": {
"vscode": {
"settings": {
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/prek.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Prek checks
on: [push, pull_request]

jobs:
prek:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: j178/prek-action@v1
17 changes: 0 additions & 17 deletions .github/workflows/ruff.yml

This file was deleted.

8 changes: 0 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,6 @@ repos:
- id: black
stages: [pre-commit]

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier
types_or: [javascript, jsx, ts, tsx, markdown, yaml, json]
stages: [pre-commit]
exclude: ^nb_cli/template/project/.*\.json$

- repo: https://github.com/nonebot/nonemoji
rev: v0.1.4
hooks:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ _✨ NoneBot2 命令行工具 ✨_
<a href="https://github.com/nonebot/nb-cli/actions/workflows/website-deploy.yml">
<img src="https://github.com/nonebot/nb-cli/actions/workflows/website-deploy.yml/badge.svg?branch=master&event=push" alt="site"/>
</a>
<a href="https://results.pre-commit.ci/latest/github/nonebot/nb-cli/master">
<img src="https://results.pre-commit.ci/badge/github/nonebot/nb-cli/master.svg" alt="pre-commit" />
<a href="https://github.com/j178/prek">
<img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/j178/prek/master/docs/assets/badge-v0.json" alt="prek">
</a>
<br />
<a href="https://jq.qq.com/?_wv=1027&k=5OFifDh">
Expand Down
77 changes: 26 additions & 51 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 22 additions & 22 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,37 +37,24 @@ dependencies = [
"pip>=25.3",
]

[project.urls]
homepage = "https://cli.nonebot.dev/"
repository = "https://github.com/nonebot/nb-cli"

[tool.pdm.dev-dependencies]
[dependency-groups]
i18n = ["babel ~=2.11"]
dev = [
"ruff ~=0.14",
"isort ~=5.10",
"black >=22.3.0",
"nonemoji ~=0.1",
"pre-commit ~=3.1",
"ruff ~=0.14",
"isort ~=5.10",
"black >=22.3.0",
"nonemoji ~=0.1",
"prek>=0.3.2",
]
docs = ["nb-autodoc >=1.0.3"]

[tool.pdm.scripts]
autodoc = { shell = "rm -rf ./website/docs/api/* && nb-autodoc nb_cli -s nb_cli.template && cp -r ./build/nb_cli/* ./website/docs/api/" }
extract = "pybabel extract -o messages.pot --project nb-cli --version 1.0.0 nb_cli/"
_init = "pybabel init -D nb-cli -i messages.pot -d nb_cli/locale/ -l {args}"
init = { composite = ["extract", "_init {args}"] }
_update = "pybabel update -D nb-cli -i messages.pot -d nb_cli/locale/"
update = { composite = ["extract", "_update"] }
compile = "pybabel compile -D nb-cli -d nb_cli/locale/"
[project.urls]
homepage = "https://cli.nonebot.dev/"
repository = "https://github.com/nonebot/nb-cli"

[project.scripts]
nb = "nb_cli.__main__:main"

[tool.pdm.build]
custom-hook = "pdm_build.py"
run-setuptools = false

[tool.pyright]
typeCheckingMode = "standard"
pythonPlatform = "All"
Expand Down Expand Up @@ -128,6 +115,19 @@ ignore = [
fixture-parentheses = false
mark-parentheses = false

[tool.pdm.scripts]
autodoc = { shell = "rm -rf ./website/docs/api/* && nb-autodoc nb_cli -s nb_cli.template && cp -r ./build/nb_cli/* ./website/docs/api/" }
extract = "pybabel extract -o messages.pot --project nb-cli --version 1.0.0 nb_cli/"
_init = "pybabel init -D nb-cli -i messages.pot -d nb_cli/locale/ -l {args}"
init = { composite = ["extract", "_init {args}"] }
_update = "pybabel update -D nb-cli -i messages.pot -d nb_cli/locale/"
update = { composite = ["extract", "_update"] }
compile = "pybabel compile -D nb-cli -d nb_cli/locale/"

[tool.pdm.build]
custom-hook = "pdm_build.py"
run-setuptools = false

[build-system]
requires = ["pdm-backend", "babel~=2.11"]
build-backend = "pdm.backend"