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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -139,5 +139,10 @@ cython_debug/

/.acli/

.qoder/

# Local design/analysis docs — kept out of the public repo
/md/

# Local PyPI investigation tooling; the CI guard lives in tests/unit/.
/scripts/
104 changes: 85 additions & 19 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,50 @@ repos:
rev: v4.3.0
hooks:
- id: check-ast
exclude: ^(tests/legacy|samples)/
exclude: ^tests/legacy/
- id: sort-simple-yaml
exclude: ^(tests/legacy|samples)/
exclude: ^tests/legacy/
- id: check-yaml
exclude: |
(?x)^(
meta.yaml
| tests/legacy/
| samples/
)$
- id: check-xml
exclude: ^(tests/legacy|samples)/
exclude: ^tests/legacy/
- id: check-toml
exclude: ^(tests/legacy|samples)/
exclude: ^tests/legacy/
- id: check-docstring-first
exclude: ^(tests/legacy|samples)/
exclude: ^tests/legacy/
- id: check-json
exclude: ^(tests/legacy|samples)/
exclude: ^tests/legacy/
- id: fix-encoding-pragma
exclude: ^(tests/legacy|samples)/
exclude: ^tests/legacy/
- id: detect-private-key
exclude: ^(tests/legacy|samples)/
exclude: ^tests/legacy/
- id: trailing-whitespace
exclude: ^(tests/legacy|samples)/
exclude: ^tests/legacy/
- repo: https://github.com/asottile/add-trailing-comma
rev: v3.1.0
hooks:
- id: add-trailing-comma
exclude: ^(tests/legacy|samples)/
# examples/01_atomic_capabilities/audio is ported verbatim from the sibling repo's
# samples/ tree, whose hooks exempt samples/.
exclude: ^(tests/legacy|examples/01_atomic_capabilities/audio)/
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.7.0
hooks:
- id: mypy
# examples/01_atomic_capabilities/audio: mypy cannot map the
# digit-leading 01_atomic_capabilities segment to a module name
# (reports duplicate _common).
exclude:
(?x)(
pb2\.py$
| grpc\.py$
| ^docs
| ^tests/legacy/
| ^samples/
| ^examples/01_atomic_capabilities/audio/
| \.html$
| \.pyi$
)
Expand All @@ -63,22 +67,22 @@ repos:
hooks:
- id: black
args: [ --line-length=79 ]
exclude: ^(tests/legacy|samples)/
exclude: ^(tests/legacy|examples/01_atomic_capabilities/audio)/
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
hooks:
- id: flake8
args: [ "--extend-ignore=E203"]
exclude: ^(tests/legacy|samples)/
exclude: ^(tests/legacy|examples/01_atomic_capabilities/audio)/
- repo: https://github.com/pylint-dev/pylint
rev: v3.0.2
hooks:
- id: pylint
exclude:
(?x)(
^docs
| ^tests/legacy/
| ^samples/
| ^tests/
| ^examples/01_atomic_capabilities/audio/
| pb2\.py$
| grpc\.py$
| \.demo$
Expand Down Expand Up @@ -119,24 +123,86 @@ repos:
--disable=C0115, # Disable missing class docstring for quick dev
--disable=C0116, # Disable missing function or method docstring for quick dev
]
# Tests get their own entry (pylint 3.0.2 discovers rcfiles from the
# invocation CWD, not per linted-file directory, so a tests/pylintrc
# would never be found): source-oriented checks that fight idiomatic
# pytest are disabled here only, keeping dashscope/ on the strict set.
# W0621 fixture shadowing, W0613 mock handlers ignoring the request,
# W0212 tests reaching into _private members by design.
- id: pylint
name: pylint (tests)
files: ^tests/
exclude: ^tests/legacy/
args: [
--disable=W0511,
--disable=W0718,
--disable=W0122,
--disable=C0103,
--disable=R0913,
--disable=E0401,
--disable=E1101,
--disable=C0415,
--disable=W0603,
--disable=R1705,
--disable=R0914,
--disable=E0601,
--disable=W0602,
--disable=W0604,
--disable=R0801,
--disable=R0902,
--disable=R0903,
--disable=C0123,
--disable=W0231,
--disable=W1113,
--disable=W0221,
--disable=R0401,
--disable=W0632,
--disable=W0123,
--disable=C3001,
--disable=W0201,
--disable=C0302,
--disable=W1203,
--disable=C2801,
--disable=C0114, # Disable missing module docstring for quick dev
--disable=C0115, # Disable missing class docstring for quick dev
--disable=C0116, # Disable missing function or method docstring for quick dev
--disable=W0621,
--disable=W0613,
--disable=W0212,
# ``assert x == []`` reads better than ``assert not x`` in pytest
# failure output, so C1803's simplification is unwanted here.
--disable=C1803,
# Long sequential arrange/act scripts are normal in integration
# tests; splitting them for R0915 hurts readability.
--disable=R0915,
# Table-driven tests are branchy by nature (R0912); test doubles
# deliberately hold resources open to assert lifecycle order
# (R1732); passthrough lambda seams read clearer than direct
# method refs (W0108); explicit trailing ``return`` marks the
# end of scripted callbacks (R1711).
--disable=R0912,
--disable=R1732,
--disable=W0108,
--disable=R1711,
]
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v7.32.0
hooks:
- id: eslint
files: \.(js|jsx)$
exclude: '(.*js_third_party.*|^tests/legacy/|^samples/)'
exclude: '(.*js_third_party.*|^tests/legacy/)'
args: [ '--fix' ]
- repo: https://github.com/thibaudcolas/pre-commit-stylelint
rev: v14.4.0
hooks:
- id: stylelint
files: \.(css)$
exclude: '(.*css_third_party.*|^tests/legacy/|^samples/)'
exclude: '(.*css_third_party.*|^tests/legacy/)'
args: [ '--fix' ]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: 'v3.0.0'
hooks:
- id: prettier
additional_dependencies: [ 'prettier@3.0.0' ]
files: \.(tsx?)$
exclude: ^(tests/legacy|samples)/
exclude: ^tests/legacy/
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ include dashscope/__init__.pyi
include NOTICE
include LICENSE.certifi
recursive-include dashscope/acli/examples *.md *.toml *.py
recursive-include examples *.md *.py
include requirements.txt
Loading
Loading