Skip to content

Commit 022a946

Browse files
authored
Add linter for LICENSE (#9275)
We mistakenly include wrong headers to files. Let's catch them in lintrunner. Partially fixes #8418
1 parent 89a0bdf commit 022a946

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.lintrunner.toml

+26
Original file line numberDiff line numberDiff line change
@@ -343,3 +343,29 @@ init_command = [
343343
'--dry-run={{DRYRUN}}',
344344
'--requirement=requirements-lintrunner.txt',
345345
]
346+
347+
[[linter]]
348+
code = 'LICENSELINT'
349+
include_patterns = [
350+
'**/*',
351+
]
352+
exclude_patterns = [
353+
'**/fb/**',
354+
'.lintrunner.toml',
355+
]
356+
command = [
357+
'python',
358+
'-m',
359+
'lintrunner_adapters',
360+
'run',
361+
'grep_linter',
362+
'--pattern=Confidential and proprietary',
363+
'--linter-name=LICENSELINT',
364+
'--error-name=Wrong license',
365+
"""--error-description=\
366+
Code contributed to ExecuTorch open source repo should have \
367+
BSD-license header \
368+
""",
369+
'--',
370+
'@{{PATHSFILE}}',
371+
]

0 commit comments

Comments
 (0)