Skip to content

Mark auto-generated files for GitHub linguist#5269

Merged
janniklasrose merged 2 commits into
mainfrom
janniklasrose/generated-linguist
May 21, 2026
Merged

Mark auto-generated files for GitHub linguist#5269
janniklasrose merged 2 commits into
mainfrom
janniklasrose/generated-linguist

Conversation

@janniklasrose
Copy link
Copy Markdown
Contributor

@janniklasrose janniklasrose commented May 19, 2026

Changes

Extend linguist-generated=true coverage so generated files don't pollute language stats or show up as hand-written code in review. Follows the existing convention of one local .gitattributes per generated folder (alongside bundle/schema/, bundle/internal/tf/, bundle/internal/validation/generated/, acceptance/, integration/).

New / updated local files:

Generator .gitattributes location Pattern
./task generate-direct bundle/direct/dresources/ *.generated.yml
./task generate-schema-docs bundle/schema/ (extended) jsonschema_for_docs.json
./task generate-schema bundle/internal/schema/ annotations_openapi.yml
./task generate-docs bundle/docsgen/output/ *.md
mockery internal/mocks/ *.go
./task pydabs-codegen python/databricks/bundles/ {catalogs,jobs,pipelines,schemas,volumes}/**

Excluded by request from review:

  • internal/genkit/tagging.py{,.lock} and .github/workflows/tagging.yml — kept visible because changes there can affect the release process (@andrewnester).
  • acceptance/**/out* and acceptance/**/output/** — kept visible because acceptance-output diffs are how reviewers detect behavior changes (@pietern, @andrewnester).

Why

bundle/direct/dresources/apitypes.generated.yml (and resources.generated.yml) were showing up as human-authored code on GitHub. The genkit-managed section of the root .gitattributes only covers cmd/account/** and cmd/workspace/**, so the rest of the auto-generated tree was unmarked. This brings linguist's view in line with .agent/rules/auto-generated-files.md.

Tests

Verified each pattern with git check-attr linguist-generated <path>:

  • Intended generated files resolve to true.
  • Adjacent manually-maintained files stay unspecified: bundle/direct/dresources/apitypes.yml, bundle/internal/schema/annotations.yml, bundle/internal/schema/annotations_openapi_overrides.yml, bundle/docsgen/{main.go,README.md}, bundle/schema/schema.go, internal/mocks/README.md, python/databricks/bundles/{__init__.py,build.py,core/**}.
  • Pre-existing local .gitattributes files (TF schema, validation generated, bundle/schema/jsonschema.json, acceptance out.test.toml) still resolve correctly.

./task ws passes.

This PR was written by Claude Code.

Extends linguist-generated coverage beyond the genkit CLI stubs in
cmd/account and cmd/workspace to include direct engine YAML, schema
artifacts, mocks, pydabs codegen, acceptance test golden outputs, and
the genkit-managed tagging workflow. Entries land in
.gitattributes.manual so they survive `./task generate-genkit`, which
overwrites .gitattributes and then prepends the manual file.

Co-authored-by: Isaac
Comment thread .gitattributes Outdated

# Acceptance test golden outputs (./task test-update, ./task test-update-templates)
acceptance/**/out* linguist-generated=true
acceptance/**/output/** linguist-generated=true
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I like seeing these on all PRs because it forces you to acknowledge any side effects of the change.

Sometimes the unexpected behavior is captured only inside the output files.

Comment thread .gitattributes Outdated
python/databricks/bundles/volumes/** linguist-generated=true

# Acceptance test golden outputs (./task test-update, ./task test-update-templates)
acceptance/**/out* linguist-generated=true
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think all the output of the acceptance test is important to see explicitly as it helps to detect the changes in behaviour

Comment thread .gitattributes Outdated
internal/mocks/**/*.go linguist-generated=true

# Genkit-generated tagging artifacts (./task generate-genkit)
internal/genkit/tagging.py linguist-generated=true
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd maybe keep this unhidden because if there's something changes here it can affect the release process

Follow the existing pattern of local .gitattributes files (bundle/schema/,
bundle/internal/tf/, bundle/internal/validation/generated/, acceptance/,
integration/) instead of one large block in the root .gitattributes.

Also drop entries the reviewers asked to leave visible:
- internal/genkit/tagging.py{,.lock} and .github/workflows/tagging.yml
  (release-relevant)
- acceptance/**/out* and acceptance/**/output/** (acceptance output changes
  are signal in code review)
@janniklasrose janniklasrose added this pull request to the merge queue May 21, 2026
Merged via the queue into main with commit 67c9f3e May 21, 2026
36 checks passed
@janniklasrose janniklasrose deleted the janniklasrose/generated-linguist branch May 21, 2026 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants