Skip to content

fix: auto-format git add -A stages all changes, not just formatted files #27

@tsavo-at-pieces

Description

@tsavo-at-pieces

Problem

The auto-format job in ci.skeleton.yaml line 70 uses git add -A after running dart format --line-length X lib/. This stages all changes in the working directory, not just the files that dart format modified.

Impact

  • If any other process modified files between checkout and format, those changes get committed as "bot(format)"
  • If .g.dart files exist and dart format reformats them, they get included in the bot commit
  • Any file drift from the checkout ref gets silently committed

Current behavior (ci.skeleton.yaml line 68-70):

git add -A
git commit -m "bot(format): apply dart format --line-length <%line_length%> [skip ci]"

Expected behavior:

Only stage files that dart format actually changed:

git diff --name-only | xargs git add
git commit -m "bot(format): apply dart format --line-length <%line_length%> [skip ci]"

Or more precisely, only add lib/ Dart files:

git add lib/

Fix Plan

  • Replace git add -A with git add lib/ in the auto-format step of ci.skeleton.yaml
  • Update both the generated ci.yaml for this repo

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions