Add codespell support (config, workflow to detect/not fix) and make it fix a typo (#458)

This commit is contained in:
Wendong-Fan 2025-04-04 07:13:33 +08:00 committed by GitHub
commit 5408dcd953
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 41 additions and 1 deletions

25
.github/workflows/codespell.yml vendored Normal file
View File

@ -0,0 +1,25 @@
# Codespell configuration is within pyproject.toml
---
name: Codespell
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Annotate locations with typos
uses: codespell-project/codespell-problem-matcher@v1
- name: Codespell
uses: codespell-project/actions-codespell@v2

View File

@ -27,3 +27,11 @@ repos:
language: system
types: [python]
exclude: ^docs/cookbooks/ # Ignore files under docs/cookbooks
- repo: https://github.com/codespell-project/codespell
# Configuration for codespell is in pyproject.toml
rev: v2.4.1
hooks:
- id: codespell
additional_dependencies:
- tomli # for python_version < '3.11'

View File

@ -7,7 +7,7 @@ All with one prompt 🪄
## Dependencies:
1. I made some modificaitons to the camel repo so please first run "git clone -b feature/virtual-try-on-toolkit-and-partial-screenshot --single-branch https://github.com/camel-ai/camel.git"
1. I made some modifications to the camel repo so please first run "git clone -b feature/virtual-try-on-toolkit-and-partial-screenshot --single-branch https://github.com/camel-ai/camel.git"
2. fill in your klingai api keys for virtual try-on in camel/toolkits/virtual_try_on_toolkit.py (you can get it from https://klingai.kuaishou.com/dev-center)
3. pip install the above cloned repo

View File

@ -59,3 +59,10 @@ follow_imports = "skip"
[[tool.mypy.overrides]]
module = "utils"
ignore_missing_imports = true
[tool.codespell]
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
skip = '.git*,*.pdf,*.lock'
check-hidden = true
ignore-regex = '\bBrin\b'
ignore-words-list = 'datas'