diff --git a/.lintrunner.toml b/.lintrunner.toml index ed782b12383..842b4b1c6cb 100644 --- a/.lintrunner.toml +++ b/.lintrunner.toml @@ -343,3 +343,29 @@ init_command = [ '--dry-run={{DRYRUN}}', '--requirement=requirements-lintrunner.txt', ] + +[[linter]] +code = 'LICENSELINT' +include_patterns = [ + '**/*', +] +exclude_patterns = [ + '**/fb/**', + '.lintrunner.toml', +] +command = [ + 'python', + '-m', + 'lintrunner_adapters', + 'run', + 'grep_linter', + '--pattern=Confidential and proprietary', + '--linter-name=LICENSELINT', + '--error-name=Wrong license', + """--error-description=\ + Code contributed to ExecuTorch open source repo should have \ + BSD-license header \ + """, + '--', + '@{{PATHSFILE}}', +]