我想通过预提交忽略多个文件模式。例如“迁移/”。'和'测试/。' 但预提交配置文件中可用的排除参数仅接受字符串而不接受列表。我当前的配置文件:
.pre-commit-config.yaml
repos:
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
language_version: python3.8
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
exclude: 'migrations/.*'
Run Code Online (Sandbox Code Playgroud)
尝试将排除更改为列表,并放入 2 个排除类别。两者都是无效配置
exclude:
- 'migrations/.*'
- 'tests/.*'
Run Code Online (Sandbox Code Playgroud)
exclude: 'migrations/.*'
exclude: 'tests/.*'
Run Code Online (Sandbox Code Playgroud)