Skip to content

Align generated Dart file policy across ignore rules, docs, and CI #537

Description

@jjoonleo

Problem

The repo gives mixed guidance for generated Dart outputs. .gitignore excludes *.g.dart, *.mocks.dart, *.config.dart, and *.freezed.dart, but AGENTS guidance still tells contributors to keep generated *.g.dart / *.config.dart files in sync and to call out generated-file updates in PRs.

CI generates code, but the current freshness checks cannot reliably enforce committed generated outputs because those files are ignored and untracked.

Evidence

  • .gitignore ignores *.g.dart, *.mocks.dart, *.config.dart, and *.freezed.dart.
  • AGENTS guidance tells contributors to run dart run build_runner build --delete-conflicting-outputs, keep generated files in sync, and call out generated-file updates.
  • git ls-files shows no tracked generated Dart outputs for those patterns.
  • Ignored generated outputs exist, including lib/core/database/database.g.dart, lib/core/di/di_setup.config.dart, entity *.freezed.dart, test mocks, and Widgetbook generated directories.
  • CI runs code generation before analyze/test, but some workflows do not check the working tree afterward.
  • Workflows that run git diff --exit-code after generation still cannot detect ignored untracked generated files.

Proposed direction

Pick one explicit policy and align all repo surfaces to it:

  1. If generated Dart outputs should be committed: stop ignoring the relevant generated patterns, commit the generated outputs, and make CI fail when build_runner changes tracked generated files.
  2. If generated Dart outputs should stay uncommitted: update AGENTS/contributor guidance to say generated Dart files are local/CI artifacts, remove generated-file PR expectations for ignored outputs, and replace misleading freshness checks with checks that match the uncommitted policy.

Acceptance criteria

  • .gitignore, AGENTS/contributor guidance, and CI workflows describe the same generated-file policy.
  • The policy covers *.g.dart, *.config.dart, *.freezed.dart, *.mocks.dart, and Widgetbook-generated Dart outputs.
  • CI either verifies committed generated outputs with a check that can actually see them, or intentionally treats them as uncommitted build artifacts.
  • A fresh clone can run the documented commands and pass analyze/tests without relying on undocumented generated-file assumptions.

Source: Codex codebase audit on 2026-06-28.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CI/CDcontinuous integration and continuous deliverycodex-readyCan be started independently by a Codex thread nowdocsDocumentation worksetupenvironment setup or library integration

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions