Skip to content

Commit 9e6cf64

Browse files
authored
Mark bun.lock as generated (#7690)
1 parent d60bb03 commit 9e6cf64

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

lib/linguist/generated.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ def generated?
7575
esy_lock? ||
7676
npm_shrinkwrap_or_package_lock? ||
7777
pnpm_lock? ||
78+
bun_lock? ||
7879
terraform_lock? ||
7980
generated_yarn_plugnplay? ||
8081
godeps? ||
@@ -503,6 +504,13 @@ def pnpm_lock?
503504
!!name.match(/pnpm-lock\.yaml/)
504505
end
505506

507+
# Internal: Is the blob a generated bun lockfile?
508+
#
509+
# Returns true or false.
510+
def bun_lock?
511+
!!name.match(/(?:^|\/)bun\.lockb?$/)
512+
end
513+
506514
# Internal: Is the blob a generated Yarn Plug'n'Play?
507515
#
508516
# Returns true or false.

test/test_generated.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ def test_check_generated
9696
# pnpm lockfile
9797
generated_sample_without_loading_data("Dummy/pnpm-lock.yaml")
9898

99+
# Bun lockfile
100+
generated_sample_without_loading_data("JSON/filenames/bun.lock")
101+
99102
# Yarn Plug'n'Play file
100103
generated_sample_without_loading_data(".pnp.js")
101104
generated_sample_without_loading_data(".pnp.cjs")

0 commit comments

Comments
 (0)