-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
111 lines (102 loc) · 16.3 KB
/
.pre-commit-config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# pre-commit stop running hooks after the first failure.
fail_fast: true
# A list of repository mappings
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
# Remove spaces at end of lines except markdown
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
exclude: '(site|site/development|site/tags|site/search|site/en|site/assets|site/stylesheets|site/development/database|site/development/tools|site/development/programming|site/development/cloud|site/development/embedded|site/development/database/mariadb|site/development/database/dynamodb|site/development/database/mongodb|site/development/database/mongodb/install\-mongodb|site/development/database/mongodb/images|site/development/database/mongodb/mongosh|site/development/database/mongodb/pymongo|site/development/database/mongodb/mongodb\-compass|site/development/tools/design|site/development/tools/ci|site/development/tools/version\-control|site/development/tools/editors|site/development/tools/document|site/development/tools/shortcuts|site/development/tools/design/inkscape|site/development/tools/design/inkscape/images|site/development/tools/ci/post\-commit|site/development/tools/ci/pre\-commit|site/development/tools/version\-control/git|site/development/tools/editors/vi|site/development/tools/editors/vscode|site/development/tools/editors/vscode/images|site/development/tools/editors/vscode/setting|site/development/tools/editors/vscode/extention|site/development/tools/document/markdown|site/development/tools/document/pkm|site/development/tools/document/mkdocs|site/development/tools/document/pkm/obsidian|site/development/tools/document/pkm/workflowy|site/development/tools/document/pkm/obsidian/images|site/development/tools/document/pkm/obsidian/community_plugins|site/development/tools/document/pkm/obsidian/community_plugins/plantuml|site/development/tools/document/pkm/obsidian/community_plugins/auto_template_trigger|site/development/tools/document/mkdocs/doc_config|site/development/tools/document/mkdocs/display\-config|site/development/programming/applescript|site/development/programming/python|site/development/programming/applescript/example|site/development/programming/python/pymysql|site/development/programming/python/images|site/development/programming/python/mdformat|site/development/programming/python/dash\-plotly|site/development/cloud/aws|site/development/cloud/aws/dynamodb|site/development/cloud/aws/aws\-cli|site/development/cloud/aws/dynamodb/dynamodb\-local|site/development/embedded/raspberrypi|site/development/embedded/raspberrypi/raspberrypi\-ubuntu|site/en/database|site/en/command\-line\-tool|site/en/development|site/en/markdown|site/en/tags0|site/en/tags|site/en/aws|site/en/application|site/en/programming\-language|site/en/raspberrypi|site/en/database/mariadb|site/en/database/dynamodb|site/en/database/mongodb|site/en/database/mongodb/install\-mongodb|site/en/database/mongodb/images|site/en/database/mongodb/mongosh|site/en/database/mongodb/pymongo|site/en/database/mongodb/mongodb\-compass|site/en/command\-line\-tool/vi|site/en/command\-line\-tool/git|site/en/command\-line\-tool/vi/vi\-tips|site/en/command\-line\-tool/git/git\-tips|site/en/development/database|site/en/development/tools|site/en/development/programming|site/en/development/cloud|site/en/development/embedded|site/en/development/database/mariadb|site/en/development/database/dynamodb|site/en/development/database/mongodb|site/en/development/database/mongodb/install\-mongodb|site/en/development/database/mongodb/mongosh|site/en/development/database/mongodb/pymongo|site/en/development/database/mongodb/mongodb\-compass|site/en/development/tools/design|site/en/development/tools/ci|site/en/development/tools/version\-control|site/en/development/tools/editors|site/en/development/tools/document|site/en/development/tools/shortcuts|site/en/development/tools/design/inkscape|site/en/development/tools/ci/post\-commit|site/en/development/tools/ci/pre\-commit|site/en/development/tools/version\-control/git|site/en/development/tools/editors/vi|site/en/development/tools/editors/vscode|site/en/development/tools/editors/vscode/setting|site/en/development/tools/editors/vscode/extention|site/en/development/tools/document/markdown|site/en/development/tools/document/pkm|site/en/development/tools/document/mkdocs|site/en/development/tools/document/pkm/obsidian|site/en/development/tools/document/pkm/workflowy|site/en/development/tools/document/pkm/obsidian/community_plugins|site/en/development/tools/document/pkm/obsidian/community_plugins/plantuml|site/en/development/tools/document/pkm/obsidian/community_plugins/auto_template_trigger|site/en/development/tools/document/mkdocs/doc_config|site/en/development/tools/document/mkdocs/display\-config|site/en/development/programming/applescript|site/en/development/programming/python|site/en/development/programming/applescript/example|site/en/development/programming/python/pymysql|site/en/development/programming/python/mdformat|site/en/development/programming/python/dash\-plotly|site/en/development/cloud/aws|site/en/development/cloud/aws/dynamodb|site/en/development/cloud/aws/aws\-cli|site/en/development/cloud/aws/dynamodb/dynamodb\-local|site/en/development/embedded/raspberrypi|site/en/development/embedded/raspberrypi/raspberrypi\-ubuntu|site/en/markdown/markdown\-tips|site/en/aws/dynamodb|site/en/aws/aws_cli\-tips|site/en/aws/dynamodb/dynamodb\-local|site/en/application/inkscape|site/en/application/shortcuts|site/en/application/obsidian|site/en/application/vscode|site/en/application/workflowy|site/en/application/inkscape/images|site/en/application/obsidian/images|site/en/application/obsidian/community_plugins|site/en/application/obsidian/community_plugins/plantuml|site/en/application/obsidian/community_plugins/auto_template_trigger|site/en/application/vscode/setting\-tips|site/en/application/vscode/images|site/en/application/vscode/extention\-tips|site/en/programming\-language/applescript|site/en/programming\-language/python|site/en/programming\-language/applescript/example|site/en/programming\-language/python/mkdocs\-tips|site/en/programming\-language/python/post\-commit\-tips|site/en/programming\-language/python/images|site/en/programming\-language/python/pre\-commit\-tips|site/en/programming\-language/python/pymysql\-tips|site/en/programming\-language/python/mkdocs|site/en/programming\-language/python/dash\-plotly\-tips|site/en/programming\-language/python/mdformat\-tips|site/en/programming\-language/python/mkdocs/doc_config\-tips|site/en/programming\-language/python/mkdocs/display\-config_tips|site/en/raspberrypi/raspberrypi\-ubuntu\-tips|site/assets/images|site/assets/img|site/assets/javascripts|site/assets/stylesheets|site/assets/javascripts/lunr|site/assets/javascripts/workers|site/assets/javascripts/lunr/min)/.*'
# Make the last line of the file a newline code
- id: end-of-file-fixer
# Unify line break code to LF
exclude: '(site|site/development|site/tags|site/search|site/en|site/assets|site/stylesheets|site/development/database|site/development/tools|site/development/programming|site/development/cloud|site/development/embedded|site/development/database/mariadb|site/development/database/dynamodb|site/development/database/mongodb|site/development/database/mongodb/install\-mongodb|site/development/database/mongodb/images|site/development/database/mongodb/mongosh|site/development/database/mongodb/pymongo|site/development/database/mongodb/mongodb\-compass|site/development/tools/design|site/development/tools/ci|site/development/tools/version\-control|site/development/tools/editors|site/development/tools/document|site/development/tools/shortcuts|site/development/tools/design/inkscape|site/development/tools/design/inkscape/images|site/development/tools/ci/post\-commit|site/development/tools/ci/pre\-commit|site/development/tools/version\-control/git|site/development/tools/editors/vi|site/development/tools/editors/vscode|site/development/tools/editors/vscode/images|site/development/tools/editors/vscode/setting|site/development/tools/editors/vscode/extention|site/development/tools/document/markdown|site/development/tools/document/pkm|site/development/tools/document/mkdocs|site/development/tools/document/pkm/obsidian|site/development/tools/document/pkm/workflowy|site/development/tools/document/pkm/obsidian/images|site/development/tools/document/pkm/obsidian/community_plugins|site/development/tools/document/pkm/obsidian/community_plugins/plantuml|site/development/tools/document/pkm/obsidian/community_plugins/auto_template_trigger|site/development/tools/document/mkdocs/doc_config|site/development/tools/document/mkdocs/display\-config|site/development/programming/applescript|site/development/programming/python|site/development/programming/applescript/example|site/development/programming/python/pymysql|site/development/programming/python/images|site/development/programming/python/mdformat|site/development/programming/python/dash\-plotly|site/development/cloud/aws|site/development/cloud/aws/dynamodb|site/development/cloud/aws/aws\-cli|site/development/cloud/aws/dynamodb/dynamodb\-local|site/development/embedded/raspberrypi|site/development/embedded/raspberrypi/raspberrypi\-ubuntu|site/en/database|site/en/command\-line\-tool|site/en/development|site/en/markdown|site/en/tags0|site/en/tags|site/en/aws|site/en/application|site/en/programming\-language|site/en/raspberrypi|site/en/database/mariadb|site/en/database/dynamodb|site/en/database/mongodb|site/en/database/mongodb/install\-mongodb|site/en/database/mongodb/images|site/en/database/mongodb/mongosh|site/en/database/mongodb/pymongo|site/en/database/mongodb/mongodb\-compass|site/en/command\-line\-tool/vi|site/en/command\-line\-tool/git|site/en/command\-line\-tool/vi/vi\-tips|site/en/command\-line\-tool/git/git\-tips|site/en/development/database|site/en/development/tools|site/en/development/programming|site/en/development/cloud|site/en/development/embedded|site/en/development/database/mariadb|site/en/development/database/dynamodb|site/en/development/database/mongodb|site/en/development/database/mongodb/install\-mongodb|site/en/development/database/mongodb/mongosh|site/en/development/database/mongodb/pymongo|site/en/development/database/mongodb/mongodb\-compass|site/en/development/tools/design|site/en/development/tools/ci|site/en/development/tools/version\-control|site/en/development/tools/editors|site/en/development/tools/document|site/en/development/tools/shortcuts|site/en/development/tools/design/inkscape|site/en/development/tools/ci/post\-commit|site/en/development/tools/ci/pre\-commit|site/en/development/tools/version\-control/git|site/en/development/tools/editors/vi|site/en/development/tools/editors/vscode|site/en/development/tools/editors/vscode/setting|site/en/development/tools/editors/vscode/extention|site/en/development/tools/document/markdown|site/en/development/tools/document/pkm|site/en/development/tools/document/mkdocs|site/en/development/tools/document/pkm/obsidian|site/en/development/tools/document/pkm/workflowy|site/en/development/tools/document/pkm/obsidian/community_plugins|site/en/development/tools/document/pkm/obsidian/community_plugins/plantuml|site/en/development/tools/document/pkm/obsidian/community_plugins/auto_template_trigger|site/en/development/tools/document/mkdocs/doc_config|site/en/development/tools/document/mkdocs/display\-config|site/en/development/programming/applescript|site/en/development/programming/python|site/en/development/programming/applescript/example|site/en/development/programming/python/pymysql|site/en/development/programming/python/mdformat|site/en/development/programming/python/dash\-plotly|site/en/development/cloud/aws|site/en/development/cloud/aws/dynamodb|site/en/development/cloud/aws/aws\-cli|site/en/development/cloud/aws/dynamodb/dynamodb\-local|site/en/development/embedded/raspberrypi|site/en/development/embedded/raspberrypi/raspberrypi\-ubuntu|site/en/markdown/markdown\-tips|site/en/aws/dynamodb|site/en/aws/aws_cli\-tips|site/en/aws/dynamodb/dynamodb\-local|site/en/application/inkscape|site/en/application/shortcuts|site/en/application/obsidian|site/en/application/vscode|site/en/application/workflowy|site/en/application/inkscape/images|site/en/application/obsidian/images|site/en/application/obsidian/community_plugins|site/en/application/obsidian/community_plugins/plantuml|site/en/application/obsidian/community_plugins/auto_template_trigger|site/en/application/vscode/setting\-tips|site/en/application/vscode/images|site/en/application/vscode/extention\-tips|site/en/programming\-language/applescript|site/en/programming\-language/python|site/en/programming\-language/applescript/example|site/en/programming\-language/python/mkdocs\-tips|site/en/programming\-language/python/post\-commit\-tips|site/en/programming\-language/python/images|site/en/programming\-language/python/pre\-commit\-tips|site/en/programming\-language/python/pymysql\-tips|site/en/programming\-language/python/mkdocs|site/en/programming\-language/python/dash\-plotly\-tips|site/en/programming\-language/python/mdformat\-tips|site/en/programming\-language/python/mkdocs/doc_config\-tips|site/en/programming\-language/python/mkdocs/display\-config_tips|site/en/raspberrypi/raspberrypi\-ubuntu\-tips|site/assets/images|site/assets/img|site/assets/javascripts|site/assets/stylesheets|site/assets/javascripts/lunr|site/assets/javascripts/workers|site/assets/javascripts/lunr/min)/.*'
- id: mixed-line-ending
args: [--fix=lf]
# toml syntax check
- id: check-toml
# yaml syntax check
- id: check-yaml
# Exclude check for "could not determine a constructor for the tag 'tag:yaml.org,2002:python/name:materialx.emoji.twemoji'"
args: [--unsafe]
# https://python-poetry.org/docs/pre-commit-hooks/#usage
- repo: https://github.com/python-poetry/poetry
rev: 2.0.0
hooks:
- id: poetry-check
verbose: true
- id: poetry-lock
verbose: true
- repo: local
hooks:
- id: poetry-export
name: Export requirements.txt
entry: poetry export -f requirements.txt -o requirements.txt --without-hashes
language: python
pass_filenames: false
additional_dependencies:
- "poetry"
- "poetry-plugin-export"
- id: poetry-export-dev
name: Export dev requirements.txt
entry: poetry export --with dev -f requirements.txt -o requirements-dev.txt --without-hashes
language: python
pass_filenames: false
additional_dependencies:
- "poetry"
- "poetry-plugin-export"
# https://github.com/shellcheck-py/shellcheck-py?tab=readme-ov-file#usage
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
- repo: https://github.com/rhysd/actionlint
rev: v1.7.6
hooks:
- id: actionlint
#- repo: https://github.com/executablebooks/mdformat
# rev: 0.7.17
# hooks:
# - id: mdformat
# args: ["--check"]
# additional_dependencies:
# - mdformat-admon
# - mdformat-footnote
# - mdformat-frontmatter
# Reference: https://github.com/DavidAnson/markdownlint-cli2#overview
# > markdownlint-cli is a traditional command-line interface for markdownlint.
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.43.0
hooks:
- id: markdownlint
args: ["--config", ".markdownlint.jsonc", "README.md", "docs/**/*.md"]
# Reference: https://github.com/DavidAnson/markdownlint-cli2#overview
# > markdownlint-cli2はmarkdownlint用の少し型破りなコマンドラインインターフェイスです。
# > markdownlint-cli2は設定ベースで、速度とシンプルさを優先しています。
# > markdownlint-cli2はmarkdownlint-cliのすべての機能をサポートしています(少し異なる場合もあります)。
#- repo: https://github.com/DavidAnson/markdownlint-cli2
# rev: v0.10.0
# hooks:
# - id: markdownlint-cli2
# args:
# [
# "--fix",
# "--config",
# ".markdownlint.jsonc",
# "README.md",
# "docs/**/*.md",
# ]
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.9.1
hooks:
- id: ruff
args: ["--fix", "ci"]
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.14.1
hooks:
- id: mypy
additional_dependencies: [types-requests==2.32.0.20240622]
args: [--config-file=pyproject.toml]