Skip to content

Commit ff71845

Browse files
committed
Add Starlark/Buck2 related extensions
These are marked as Bazel, because there's no particular reason to treat them as anything else. Additionally, this expands the bazel-verse by adding a Starlark type: https://starlark-lang.org/ which is the language used by Copybara, Bazel, and Buck2. This lets us annotate non-Bazel Starlark as being Starlark but not Bazel, while Bazel Starlark is also Starlark. .sky is used by Copybara (actually more specifically .bara.sky). .star I've seen used in the test suite of starlark-rust, and it seems harmless to add. lib.star is mentioned as a filename in https://starlark-lang.org/spec.html. Reference: - https://buck2.build/docs/bxl/ - https://buck2.build/docs/rule_authors/package_files/
1 parent 3ac75fa commit ff71845

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

identify/extensions.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
'bmp': {'binary', 'image', 'bitmap'},
2323
'bz2': {'binary', 'bzip2'},
2424
'bz3': {'binary', 'bzip3'},
25-
'bzl': {'text', 'bazel'},
25+
'bxl': {'text', 'bazel'},
26+
'bzl': {'text', 'bazel', 'starlark'},
2627
'c': {'text', 'c'},
2728
'c++': {'text', 'c++'},
2829
'c++m': {'text', 'c++'},
@@ -247,6 +248,7 @@
247248
'scm': {'text', 'scheme'},
248249
'scss': {'text', 'scss'},
249250
'sh': {'text', 'shell'},
251+
'sky': {'text', 'starlark'},
250252
'sln': {'text', 'sln'},
251253
'slnx': {'text', 'xml', 'slnx', 'msbuild'},
252254
'sls': {'text', 'salt'},
@@ -255,6 +257,7 @@
255257
'spec': {'text', 'spec'},
256258
'sql': {'text', 'sql'},
257259
'ss': {'text', 'scheme'},
260+
'star': {'text', 'starlark'},
258261
'sty': {'text', 'tex'},
259262
'styl': {'text', 'stylus'},
260263
'sv': {'text', 'system-verilog'},
@@ -390,6 +393,7 @@
390393
'bblayers.conf': EXTENSIONS['bb'],
391394
'bitbake.conf': EXTENSIONS['bb'],
392395
'Brewfile': EXTENSIONS['rb'],
396+
'BUCK': EXTENSIONS['bzl'],
393397
'BUILD': EXTENSIONS['bzl'],
394398
'Cargo.toml': EXTENSIONS['toml'] | {'cargo'},
395399
'Cargo.lock': EXTENSIONS['toml'] | {'cargo-lock'},
@@ -398,7 +402,6 @@
398402
'config.ru': EXTENSIONS['rb'],
399403
'Containerfile': {'text', 'dockerfile'},
400404
'CONTRIBUTING': EXTENSIONS['txt'],
401-
'copy.bara.sky': EXTENSIONS['bzl'],
402405
'COPYING': EXTENSIONS['txt'],
403406
'Dockerfile': {'text', 'dockerfile'},
404407
'direnvrc': EXTENSIONS['bash'],
@@ -418,6 +421,7 @@
418421
'makefile': EXTENSIONS['mk'],
419422
'NEWS': EXTENSIONS['txt'],
420423
'NOTICE': EXTENSIONS['txt'],
424+
'PACKAGE': EXTENSIONS['bzl'],
421425
'PATENTS': EXTENSIONS['txt'],
422426
'Pipfile': EXTENSIONS['toml'],
423427
'Pipfile.lock': EXTENSIONS['json'],

0 commit comments

Comments
 (0)