Skip to content

build: add generated files lists/patterns to .gitattributes#15649

Merged
rmuir merged 1 commit intoapache:mainfrom
rmuir:linguist-generated
Feb 1, 2026
Merged

build: add generated files lists/patterns to .gitattributes#15649
rmuir merged 1 commit intoapache:mainfrom
rmuir:linguist-generated

Conversation

@rmuir
Copy link
Member

@rmuir rmuir commented Jan 31, 2026

This is a nice easy win on the PR review, since generated files are folded away and clearly marked in the UI.

Some patterns were used to try to keep this low-maintenance, but I tried to not make the patterns too aggressive that they'd bring in false positives.

Closes #14833

This is a nice easy win on the PR review, since generated files are
folded away and clearly marked in the UI.

Some patterns were used to try to keep this low-maintenance, but I tried
to not make the patterns too aggressive that they'd bring in false
positives.

Closes apache#14833
@rmuir rmuir added the skip-changelog Apply to PRs that don't need a changelog entry, stopping the automated changelog check. label Jan 31, 2026
@uschindler
Copy link
Contributor

Why is this called "linguist-generated"? No worries, I am just interested!

@rmuir
Copy link
Member Author

rmuir commented Jan 31, 2026

Copy link
Contributor

@dweiss dweiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't know about such a thing. Interesting.

@uschindler
Copy link
Contributor

It would be cool if all regenerate tasks make sure the file is listed there. Basically all files listed with json hash should appear here.
Maybe think about that as separate issue.

@rmuir
Copy link
Member Author

rmuir commented Feb 1, 2026

It would be cool if all regenerate tasks make sure the file is listed there. Basically all files listed with json hash should appear here.
Maybe think about that as separate issue.

Could be done with git check-attr linguist-generated <file> maybe. i dont want to mess with that here.

The way in which this is used by the github UI... it is not critical that the attributes are perfect.

Github even does a bunch of assumptions and guesswork already today: you can use -linguist-generated syntax to disable their guesswork in cases where they are wrong.

Try not to think of this feature like a German. :)

@rmuir
Copy link
Member Author

rmuir commented Feb 1, 2026

also, IMO an easy solution to managing the generated files, is to always put them in a subdirectory named generated.

Then you can use glob such as **/generated/** in this file, github actions include/exclude, prek include/exclude, etc.

It also stands out MUCH better as file is very clearly indicated as generated by having the word in its path.

@rmuir rmuir merged commit 5bf2835 into apache:main Feb 1, 2026
13 of 14 checks passed
finnroblin pushed a commit to finnroblin/lucene that referenced this pull request Feb 2, 2026
…5649)

This is a nice easy win on the PR review, since generated files are
folded away and clearly marked in the UI.

Some patterns were used to try to keep this low-maintenance, but I tried
to not make the patterns too aggressive that they'd bring in false
positives.

Closes apache#14833
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Apply to PRs that don't need a changelog entry, stopping the automated changelog check.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add generated files lists/patterns to .gitattributes

3 participants