From 39cb345fabbea2a380c0db2ac6bf5cde46b8eb2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Cie=C5=9Blak?= Date: Wed, 26 Oct 2022 12:06:54 +0200 Subject: [PATCH] Make linguist correctly classify JS protobuf files (#17782) 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 --- .gitattributes | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitattributes b/.gitattributes index 29f26b1f7a0..1d6e677fe8d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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