Skip to content

Commit

Permalink
feat: mark deno lockfiles as generated
Browse files Browse the repository at this point in the history
  • Loading branch information
lishaduck committed Jun 14, 2024
1 parent 42fd3c2 commit 2726660
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
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? ||
cargo_orig? ||
deno_lock? ||
flake_lock? ||
bazel_lock? ||
node_modules? ||
Expand Down Expand Up @@ -429,6 +430,13 @@ def esy_lock?
!!name.match(/(^|\/)(\w+\.)?esy.lock$/)
end

# Internal: Is the blob a generated deno lockfile, which are not meant for humans in pull requests.
#
# Returns true or false.
def deno_lock?
!!name.match(/deno\.lock/)
end

# Internal: Is the blob a generated npm shrinkwrap or package lock file?
#
# Returns true or false.
Expand Down
3 changes: 3 additions & 0 deletions test/test_blob.rb
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ def test_generated
# Bazel generated bzlmod lockfile
assert sample_blob_memory("JSON/filenames/MODULE.bazel.lock").generated?

# Deno generated deno.lock file
assert sample_blob_memory("JSON/filenames/deno.lock").generated?

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

Expand Down

0 comments on commit 2726660

Please sign in to comment.