-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
140 lines (126 loc) · 3.85 KB
/
.pre-commit-config.yaml
File metadata and controls
140 lines (126 loc) · 3.85 KB
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# Copyright (c) 2024 RapidStream Design Automation, Inc. and contributors.
# All rights reserved. The contributor(s) of this file has/have agreed to the
# RapidStream Contributor License Agreement.
exclude: .*\.patch
repos:
############################
# Built-in Common Checks #
############################
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
args:
- --maxkb=1024
- id: check-ast
- id: check-builtin-literals
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-symlinks
- id: check-toml
- id: check-vcs-permalinks
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: destroyed-symlinks
- id: detect-private-key
- id: end-of-file-fixer
- id: file-contents-sorter
files: (.gitignore|requirements.(txt|in))$
- id: fix-byte-order-marker
- id: forbid-new-submodules
- id: forbid-submodules
- id: mixed-line-ending
- id: pretty-format-json
args:
- --autofix
- --indent=4
- id: trailing-whitespace
#####################
# Auto Formatting #
#####################
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v20.1.8
hooks:
- id: clang-format
files: \.(c|cc|cpp|h|hpp)$
- repo: https://github.com/keith/pre-commit-buildifier
rev: 8.2.0
hooks:
- id: buildifier
- id: buildifier-lint
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.4
hooks:
- id: ruff
args: [ --fix, --unsafe-fixes ]
- id: ruff-format
- repo: https://github.com/PyCQA/docformatter
rev: v1.7.7
hooks:
- id: docformatter
additional_dependencies: [tomli]
args:
- --in-place
- --config=pyproject.toml
#############
# Linting #
#############
- repo: https://github.com/codespell-project/codespell
rev: "v2.4.1"
hooks:
- id: codespell
types_or: [asciidoc, python, markdown, rst]
additional_dependencies: [tomli]
###################
# Type Checking #
###################
- repo: https://github.com/RobertCraigie/pyright-python
rev: v1.1.403
hooks:
- id: pyright
exclude: /gen_config\.py$ # ignore modules that imports rapidstream
# reading deps from file is not supported to ensure caching correctness
additional_dependencies:
- click
- coloredlogs
- intervaltree
- jinja2
- networkx
- nodejs-wheel-binaries # default node does not work due to old glibc
- nuitka
- psutil
- pydantic
- pyslang==8.1.0 # specific version needed for pyslang stub
- pytest
- pyverilog
- pyyaml
- toposort
###############
# Copyright #
###############
- repo: https://github.com/google/pre-commit-tool-hooks
rev: v1.2.5
hooks:
- id: check-links
- id: check-copyright
args:
- --copyright
- |+
Copyright (c) YYYY RapidStream Design Automation, Inc. and contributors.
All rights reserved. The contributor(s) of this file has/have agreed to the
RapidStream Contributor License Agreement.
- --skip_pattern
- "(?:\
LICENSE|VERSION|requirements_lock.txt|_redirects|pnpm-lock.yaml|\
\\.(?:ico|json|v|sv|vhd|bin|tcl|rst|xci|xml|csv|rpt|bd|ini|ipynb|lock|gitignore|pptx|svg|in|td|txt|bazelrc|actrc)\
)$"
- --custom_format
- '\.(rs|ts|tsx|mjs|cjs|c|hpp)$'
- ""
- "// "
- ""