Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register MODULE.bazel.lock as JSON and generated #6783

Merged
merged 2 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions lib/linguist/generated.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def generated?
composer_lock? ||
cargo_lock? ||
flake_lock? ||
bazel_lock? ||
node_modules? ||
go_vendor? ||
go_lock? ||
Expand Down Expand Up @@ -484,6 +485,13 @@ def flake_lock?
!!name.match(/(^|\/)flake\.lock$/)
end

# Internal: Is the blob a Bazel generated bzlmod lockfile?
#
# Returns true or false
def bazel_lock?
!!name.match(/(^|\/)MODULE\.bazel\.lock$/)
end

# Is the blob a VCR Cassette file?
#
# Returns true or false
Expand Down
1 change: 1 addition & 0 deletions lib/linguist/languages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3211,6 +3211,7 @@ JSON:
- ".tern-config"
- ".tern-project"
- ".watchmanconfig"
- MODULE.bazel.lock
- Pipfile.lock
- composer.lock
- deno.lock
Expand Down
354 changes: 354 additions & 0 deletions samples/JSON/filenames/MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions test/test_blob.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ def test_generated
# Nix generated flake.lock file
assert sample_blob_memory("JSON/filenames/flake.lock").generated?

# Bazel generated bzlmod lockfile
assert sample_blob_memory("JSON/filenames/MODULE.bazel.lock").generated?

# pnpm lockfile
assert fixture_blob_memory("YAML/pnpm-lock.yaml").generated?

Expand Down
Loading