github-linguist / github-linguist/linguist

Trim `.example` suffix when analyzing filenames

Open
#7,712 0 comments 1 reaction 0 assignees View on GitHub
Improvement
Dominant language
Ruby
Stars
13.7k
Forks
5.4k
Avg merge
1d 15h
Merged PRs (30d)
17

Description

## Describe the enhancement

Searching the `*.example` path on GitHub, I'm seeing a lot of `.example` files, such as:

- `.env.example`
- `Makefile.example`
- `README.md.example`
- `*.py.example`
- `*.js.example`

And I'm thinking that Linguist would be able to identify these files' languages correctly if it trimmed the `.example` suffix before checking the extension or filename. E.g.

- `.env.example` -> `.env` -> Dotenv (by filename)
- `README.md.example` -> `README.md` -> Markdown (by extension)

Does this make sense?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.