Skip to content

CI's dart format gate is SDK-version dependent: lib/src/slack.dart is unformatted under Dart >= 3.11 #40

Description

@riker-wamf

What happens

dart format . on a current Dart SDK rewrites one file that nobody is editing:

$ dart --version
Dart SDK version: 3.12.2 (stable) ... on "linux_x64"

$ dart format .
Formatted lib/src/slack.dart
Formatted 91 files (1 changed) in 0.30 seconds.

The change is only the trailing ; placement after the last enum value:

   /// Insert the content before the existing body.
-  prepend('insert_at_start')
-  ;
+  prepend('insert_at_start');
 
   const CanvasEditMode(this.operation);

Why it matters

CI pins the SDK and runs the formatter as a hard gate:

  • .github/workflows/dart_slack.yaml:38 — sdk: "3.10.0"
  • .github/workflows/dart_slack.yaml:44 — dart format --set-exit-if-changed .

So the gate passes today only because of the pinned version. Two consequences:

  1. Anyone with a newer local SDK who runs dart format . before committing picks up an unrelated one-file diff. It is easy to commit by accident and it makes a scoped pull request look wider than it is.
  2. When the pin is raised, dart format --set-exit-if-changed . turns red on a file the SDK bump does not otherwise touch. The failure will look like it belongs to whichever pull request raises the pin.

Acceptance criteria

  • dart format . reports no changes on the pinned SDK AND on the current stable SDK.
  • CI is unchanged in behaviour: dart format --set-exit-if-changed . still passes.

Suggested fix

Apply the formatter's output to lib/src/slack.dart in one commit of its own. The pinned 3.10.0 formatter must also accept that spelling — verify on 3.10.0 before merging, because the point of the change is to satisfy both.

How this was found

Reviewing feedback on #36. @kumar-waaf asked for a documentation fix there; running dart format produced this unrelated file change. I reverted it to keep #36 scoped, and filed it here rather than including it silently.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions