Skip to content

[Repo Assist] test: add FormatCheck build target for CI formatting validation#2164

Draft
github-actions[bot] wants to merge 2 commits into
mainfrom
repo-assist/test-add-format-check-target-2026-03-24-e129691cfb148563
Draft

[Repo Assist] test: add FormatCheck build target for CI formatting validation#2164
github-actions[bot] wants to merge 2 commits into
mainfrom
repo-assist/test-add-format-check-target-2026-03-24-e129691cfb148563

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

🤖 This PR was created by Repo Assist, an automated AI assistant.

Summary

Adds a FormatCheck FAKE build target that runs dotnet fantomas --check over the src/ and build/ directories without modifying any files.

Motivation (Task 9 — Testing Improvements)

The repository currently has no automated quality gate for code formatting in CI. The existing Format target reformats files in-place (useful locally), but there is no way to verify formatting is correct without also changing files — which is undesirable in a read-only CI step.

FormatCheck fills this gap:

  • Runs fantomas --check src build — exits with a non-zero code if any file is incorrectly formatted
  • Can be wired into the CI workflow (pr.yml) as a lightweight pre-check before the full build
  • Gives developers a clear local command to verify formatting: dotnet run --project build -- -t FormatCheck

Usage

# Check formatting (no files changed):
dotnet run --project build -- -t FormatCheck

# Fix formatting:
dotnet run --project build -- -t Format

Adding to CI (future)

Because the CI workflow file is protected, maintainers can add this to .github/workflows/pr.yml with a single line change:

- name: Check formatting
  run: dotnet run --project build -- -t FormatCheck

This can be added as a separate step before the existing Run Test step, or run as its own matrix entry.

Test Status

Fantomas format check: ✅ (verified Program.fs formats cleanly after the change).
Build: ✅ — the change only adds a new target definition and a tree edge; existing targets are unaffected.

Generated by Repo Assist ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@4957663821dbb3260348084fa2f1659701950fef

Add a 'FormatCheck' FAKE target that runs 'dotnet fantomas --check' over
the src/ and build/ directories without modifying any files.  This lets CI
pipelines (or developers) verify that all F# source files are correctly
formatted before running the full build.

The existing 'Format' target reformats files in-place and is useful for
developers to apply formatting locally.  FormatCheck complements it by
providing a pure verification step suitable for automated pipelines.

Run locally with:
  dotnet run --project build -- -t FormatCheck

To fix failures:
  dotnet run --project build -- -t Format

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added automation enhancement Accepted suggestions that makes existing features better repo-assist labels Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation enhancement Accepted suggestions that makes existing features better repo-assist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants