-
Notifications
You must be signed in to change notification settings - Fork 41.4k
Expand file tree
/
Copy pathfilters.ts
More file actions
270 lines (245 loc) · 8.65 KB
/
Copy pathfilters.ts
File metadata and controls
270 lines (245 loc) · 8.65 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { readFileSync } from 'fs';
import { join } from 'path';
/**
* Hygiene works by creating cascading subsets of all our files and
* passing them through a sequence of checks. Here are the current subsets,
* named according to the checks performed on them. Each subset contains
* the following one, as described in mathematical notation:
*
* all ⊃ eol ⊇ indentation ⊃ copyright ⊃ typescript
*/
export const all = Object.freeze<string[]>([
'*',
'build/**/*',
'extensions/**/*',
'scripts/**/*',
'src/**/*',
'test/**/*',
'!cli/**/*',
'!out*/**',
'!extensions/**/out*/**',
'!extensions/**/*-out/**',
'!test/**/out/**',
'!**/node_modules/**',
'!**/*.js.map',
'!**/*.tsbuildinfo',
]);
export const unicodeFilter = Object.freeze<string[]>([
'**',
'!**/ThirdPartyNotices.txt',
'!**/ThirdPartyNotices.cli.txt',
'!**/LICENSE.{txt,rtf}',
'!LICENSES.chromium.html',
'!**/LICENSE',
'!**/*.{dll,exe,png,bmp,jpg,gif,scpt,cur,ttf,woff,eot,template,ico,icns,opus,wasm}',
'!**/test/**',
'!**/*.test.ts',
'!**/*.{d.ts,json,md}',
'!**/*.mp3',
'!**/*.tiff',
'!**/*.provisionprofile',
'!build/win32/**',
'!extensions/markdown-language-features/notebook-out/*.js',
'!extensions/markdown-language-features/markdown-editor-out/*.js',
'!extensions/markdown-math/notebook-out/**',
'!extensions/mermaid-markdown-features/chat-webview-out/**',
'!extensions/ipynb/notebook-out/**',
'!extensions/notebook-renderers/renderer-out/**',
'!extensions/php-language-features/src/features/phpGlobalFunctions.ts',
'!extensions/terminal-suggest/src/completions/upstream/**',
'!extensions/typescript-language-features/test-workspace/**',
'!extensions/vscode-api-tests/testWorkspace/**',
'!extensions/vscode-api-tests/testWorkspace2/**',
'!extensions/**/dist/**',
'!extensions/**/out/**',
'!extensions/**/snippets/**',
'!extensions/**/colorize-fixtures/**',
'!extensions/terminal-suggest/src/shell/fishBuiltinsCache.ts',
// extensions/copilot has its own code style
'!extensions/copilot/**',
'!src/vs/base/browser/dompurify/**',
'!src/vs/workbench/services/keybinding/browser/keyboardLayouts/**',
'!src/vs/workbench/contrib/terminal/common/scripts/psreadline/**',
// Files with licences
'!src/vs/platform/endpoint/common/licenseAgreement.ts',
]);
export const indentationFilter = Object.freeze<string[]>([
'**',
// except specific files
'!**/ThirdPartyNotices.txt',
'!**/ThirdPartyNotices.cli.txt',
'!**/LICENSE.{txt,rtf}',
'!LICENSES.chromium.html',
'!**/LICENSE',
'!**/*.mp3',
'!src/vs/base/browser/dompurify/*',
'!src/vs/base/common/lit-html/**',
'!src/vs/base/common/signals-core/**',
'!src/vs/base/common/marked/marked.js',
'!src/vs/base/common/semver/semver.js',
'!src/vs/base/node/terminateProcess.sh',
'!src/vs/base/node/cpuUsage.sh',
'!src/vs/editor/common/languages/highlights/*.scm',
'!src/vs/editor/common/languages/injections/*.scm',
'!test/unit/assert.js',
'!resources/linux/snap/electron-launch',
'!build/ext.js',
'!build/darwin/patch-dmg.py',
'!build/npm/gyp/patches/gyp_spectre_mitigation_support.patch',
'!product.overrides.json',
'!src/vs/platform/endpoint/common/licenseAgreement.ts',
// except specific folders
'!test/automation/out/**',
'!test/monaco/out/**',
'!test/smoke/out/**',
'!extensions/terminal-suggest/src/shell/zshBuiltinsCache.ts',
'!extensions/terminal-suggest/src/shell/fishBuiltinsCache.ts',
'!extensions/terminal-suggest/src/completions/upstream/**',
'!extensions/typescript-language-features/test-workspace/**',
'!extensions/typescript-language-features/resources/walkthroughs/**',
'!extensions/typescript-language-features/package-manager/node-maintainer/**',
'!extensions/markdown-math/notebook-out/**',
'!extensions/ipynb/notebook-out/**',
'!extensions/vscode-api-tests/testWorkspace/**',
'!extensions/vscode-api-tests/testWorkspace2/**',
'!build/monaco/**',
'!build/win32/**',
'!build/checker/**',
'!src/vs/workbench/contrib/terminal/common/scripts/psreadline/**',
// except multiple specific files
'!**/package.json',
'!**/package-lock.json',
// except multiple specific folders
'!**/codicon/**',
'!**/fixtures/**',
'!**/lib/**',
'!extensions/**/dist/**',
'!extensions/**/out/**',
'!extensions/**/snippets/**',
'!extensions/**/syntaxes/**',
'!extensions/**/themes/**',
'!extensions/**/colorize-fixtures/**',
// extensions/copilot has its own code style
'!extensions/copilot/**',
// except specific file types
'!src/vs/*/**/*.d.ts',
'!src/typings/**/*.d.ts',
'!extensions/**/*.d.ts',
'!**/*.{svg,exe,png,bmp,jpg,gif,scpt,bat,cmd,cur,ttf,woff,eot,md,ps1,psm1,template,yaml,yml,d.ts.recipe,ico,icns,plist,opus,admx,adml,wasm}',
'!build/{lib,download,linux,darwin}/**/*.js',
'!build/**/*.sh',
'!build/azure-pipelines/**/*.js',
'!build/azure-pipelines/**/*.config',
'!build/npm/gyp/custom-headers/**',
'!**/Dockerfile',
'!**/Dockerfile.*',
'!**/*.Dockerfile',
'!**/*.dockerfile',
'!**/*.tiff',
// except for built files
'!extensions/mermaid-markdown-features/chat-webview-out/*.js',
'!extensions/mermaid-markdown-features/markdown-preview-out/*.js',
'!extensions/mermaid-markdown-features/notebook-out/*.js',
'!extensions/markdown-language-features/media/*.js',
'!extensions/markdown-language-features/markdown-editor-out/*.js',
'!extensions/markdown-language-features/notebook-out/*.js',
'!extensions/markdown-math/notebook-out/*.js',
'!extensions/ipynb/notebook-out/**',
'!extensions/notebook-renderers/renderer-out/*.js',
'!extensions/simple-browser/media/*.js',
]);
export const copyrightFilter = Object.freeze<string[]>([
'**',
'!**/*.desktop',
'!**/*.json',
'!**/*.jsonc',
'!**/*.jsonl',
'!**/*.html',
'!**/*.template',
'!**/*.md',
'!**/*.bat',
'!**/*.cmd',
'!**/*.ico',
'!**/*.gif',
'!**/*.opus',
'!**/*.mp3',
'!**/*.icns',
'!**/*.xml',
'!**/*.sh',
'!**/*.zsh',
'!**/*.fish',
'!**/*.txt',
'!**/*.xpm',
'!**/*.opts',
'!**/*.disabled',
'!**/*.code-workspace',
'!**/*.js.map',
'!**/*.wasm',
'!**/*.tiff',
'!**/*.provisionprofile',
'!build/**/*.init',
'!build/darwin/patch-dmg.py',
'!build/linux/libcxx-fetcher.*',
'!build/npm/gyp/custom-headers/**',
'!resources/linux/snap/snapcraft.yaml',
'!resources/win32/bin/code.js',
'!resources/completions/**',
'!extensions/configuration-editing/build/inline-allOf.ts',
'!extensions/markdown-language-features/media/highlight.css',
'!extensions/markdown-math/notebook-out/**',
'!extensions/ipynb/notebook-out/**',
'!extensions/simple-browser/media/codicon.css',
'!extensions/terminal-suggest/src/completions/upstream/**',
'!extensions/typescript-language-features/node-maintainer/**',
'!extensions/html-language-features/server/src/modes/typescript/*',
'!extensions/*/server/bin/*',
'!src/vs/platform/agentHost/node/codex/protocol/generated/**',
'!src/vs/workbench/contrib/terminal/common/scripts/psreadline/**',
'!extensions/mermaid-markdown-features/chat-webview-out/**',
'!extensions/mermaid-markdown-features/markdown-preview-out/**',
'!extensions/mermaid-markdown-features/notebook-out/**',
// vendored third-party libraries
'!src/vs/base/common/lit-html/**',
'!src/vs/base/common/signals-core/**',
// extensions/copilot has its own code style
'!extensions/copilot/**',
]);
export const tsFormattingFilter = Object.freeze<string[]>([
'src/**/*.ts',
'test/**/*.ts',
'extensions/**/*.ts',
'!src/vs/*/**/*.d.ts',
'!src/typings/**/*.d.ts',
'!extensions/**/*.d.ts',
'!**/fixtures/**',
'!**/typings/**',
'!**/node_modules/**',
'!extensions/**/colorize-fixtures/**',
'!extensions/vscode-api-tests/testWorkspace/**',
'!extensions/vscode-api-tests/testWorkspace2/**',
'!extensions/**/*.test.ts',
'!extensions/html-language-features/server/lib/jquery.d.ts',
'!extensions/terminal-suggest/src/shell/zshBuiltinsCache.ts',
'!extensions/terminal-suggest/src/shell/fishBuiltinsCache.ts',
'!src/vs/platform/agentHost/node/codex/protocol/generated/**',
// extensions/copilot has its own code style
'!extensions/copilot/**',
]);
export const eslintFilter = Object.freeze<string[]>([
'**/*.{js,cjs,mjs}',
'**/*.{ts,tsx,mts,cts}',
'.eslint-plugin-local/**/*.ts',
'!src/vs/platform/agentHost/node/codex/protocol/generated/**',
...readFileSync(join(import.meta.dirname, '..', '.eslint-ignore'))
.toString()
.split(/\r\n|\n/)
.filter(line => line && !line.startsWith('#'))
.map(line => line.startsWith('!') ? line.slice(1) : `!${line}`)
]);
export const stylelintFilter = Object.freeze<string[]>([
'src/**/*.css'
]);