Skip to content

Commit

Permalink
Make linguist correctly classify JS protobuf files (gravitational#17782)
Browse files Browse the repository at this point in the history
Linguist seems to expect that on line 6, those files have a specific string
in them but that's not true for our files.

Maybe that's because we use buf and not protoc to generate them.

This should automatically collapse those files in diffs and properly count
JavaScript usage in language stats for the repo.

See: https://github.com/github/linguist/blob/master/docs/overrides.md
  • Loading branch information
ravicious authored Oct 26, 2022
1 parent 49de14c commit 39cb345
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
webassets/* linguist-vendored
docs/theme/js/* linguist-vendored
docs/theme/js/theme.js linguist-vendored=false

# JS protobuf files, not caught by built-in linguist rules.
# https://github.com/github/linguist/blob/v7.23.0/lib/linguist/generated.rb#L349-L358
*_pb.js linguist-generated
*_pb.d.ts linguist-generated

0 comments on commit 39cb345

Please sign in to comment.