Skip to content

Commit

Permalink
Revert "Remove yarn.lock from auto-generated files list (follow-up) (#…
Browse files Browse the repository at this point in the history
…4459)" (#4460)

This reverts commit 3bc8185.
  • Loading branch information
lildude authored Mar 13, 2019
1 parent c71777f commit 90c7bba
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/linguist/generated.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def generated?
generated_roxygen2? ||
generated_pkgdown? ||
generated_jison? ||
generated_yarn_lock? ||
generated_grpc_cpp? ||
generated_dart? ||
generated_perl_ppport_header? ||
Expand Down Expand Up @@ -539,6 +540,15 @@ def generated_jison?
lines[0].start_with?("/* generated by jison-lex ")
end

# Internal: Is the blob a generated yarn lockfile?
#
# Returns true or false.
def generated_yarn_lock?
return false unless name.match(/yarn\.lock/)
return false unless lines.count > 0
return lines[0].include?("# THIS IS AN AUTOGENERATED FILE")
end

# Internal: Is this a protobuf/grpc-generated C++ file?
#
# A generated file contains:
Expand Down

0 comments on commit 90c7bba

Please sign in to comment.