Skip to content

linguist-generated tag not working properly. #5301

@ApoorvGuptaAi

Description

@ApoorvGuptaAi

Describe the bug

linguist-generated tag not working properly.

$ cat .gitattributes 
# Ignore these files for PR and some other processes.
# Based on https://docs.github.com/en/github/administering-a-repository/customizing-how-changed-files-appear-on-github
# Guide: https://github.com/github/linguist

# Protobuf
gui/src/protobuf/truera/protobuf/* linguist-generated
gui/src/protobuf/truera/protobuf/public/model_pb.d.ts linguist-generated
python/truera/protobuf/* linguist-generated

# OpenAPI
python/truera/modelrunner/client/* linguist-generated
gui/src/network/mrc/src/ linguist-generated

gui/package-lock.json linguist-generated

Expected behaviour

Linguist for gui/src/protobuf/truera/protobuf/public/model_pb.d.ts says generated file.
(This does not appear to be true for github either)

Actual behaviour:

$ github-linguist gui/src/protobuf/truera/protobuf/public/model_pb.d.ts
model_pb.d.ts: 156 lines (139 sloc)
  type:      Text
  mime type: video/MP2T
  language:  TypeScript
  appears to be a vendored file

Some files are marked as generated though:

$ github-linguist gui/package-lock.json 
package-lock.json: 0 lines (0 sloc)
  type:      Text
  mime type: application/json
  language:  JSON
  blob is too large to be shown
  appears to be generated source code

Additional notes

Version:

$ github-linguist --version
  Linguist v5.3.3
  Detect language type for a file, or, given a repository, determine language breakdown.

  Usage: linguist <path>
         linguist <path> [--breakdown] [--json]
         linguist [--breakdown] [--json]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions