Skip to content

chore: add .pre-commit-config.yaml and fix trailing whitespace#3430

Merged
mnriem merged 1 commit into
github:mainfrom
vincentclee:chore/add-pre-commit-config
Jul 10, 2026
Merged

chore: add .pre-commit-config.yaml and fix trailing whitespace#3430
mnriem merged 1 commit into
github:mainfrom
vincentclee:chore/add-pre-commit-config

Conversation

@vincentclee

Copy link
Copy Markdown
Contributor

Adds a .pre-commit-config.yaml with trailing-whitespace, end-of-file-fixer, check-yaml, and check-executables-have-shebangs hooks (excluding .lock.yml files generated by gh-aw).

Fixes 41 files with trailing whitespace or missing end-of-file newlines, including shipped templates (tasks.md, plan.md, specify.md, etc.) that cause managed-files-modified warnings in user projects when their own pre-commit hooks clean up these issues after specify init.

Changes

  • New: .pre-commit-config.yaml — prevents future trailing whitespace/newline regressions
  • Fixed: 41 files with trailing whitespace or missing EOF newlines (templates, scripts, tests, config files)

Why

Users with pre-commit hooks (trailing-whitespace, end-of-file-fixer) get specify integration status warnings about modified managed files because the shipped templates contain trailing whitespace that pre-commit correctly strips, causing checksum mismatches.

@vincentclee vincentclee requested a review from mnriem as a code owner July 9, 2026 17:45
@vincentclee vincentclee changed the title chore: add .pre-commit-config.yaml and fix trailing whitespace chore: add .pre-commit-config.yaml and fix trailing whitespace Jul 9, 2026
@mnriem mnriem requested a review from Copilot July 10, 2026 12:43

Copilot AI left a comment

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.

Pull request overview

Adds a repo-level pre-commit configuration to prevent trailing whitespace / missing EOF newline regressions, and normalizes existing files (including shipped templates) to avoid user-facing “managed-files-modified” warnings when users run their own formatting hooks after specify init.

Changes:

  • Added .pre-commit-config.yaml with basic hygiene hooks (trailing-whitespace, end-of-file-fixer, check-yaml, check-executables-have-shebangs) and exclusions for generated *.lock.yml.
  • Normalized trailing whitespace / EOF newlines across templates, scripts, tests, and misc repo files.
  • Minor whitespace-only cleanup in integration/test/docs content.
Show a summary per file
File Description
.pre-commit-config.yaml Adds pre-commit hooks to prevent whitespace/EOF regressions (excludes *.lock.yml).
tests/test_timestamp_branches.py Removes trailing whitespace at EOF.
tests/test_setup_tasks.py Removes trailing whitespace on blank lines throughout the test file.
tests/test_merge.py Removes trailing whitespace on blank lines in tests.
tests/test_extension_update_hardening.py Removes trailing whitespace on blank lines in tests.
tests/test_extension_registration.py Removes trailing whitespace on blank lines in tests.
tests/integrations/test_integration_vibe.py Ensures file ends with newline / removes EOF formatting noise.
tests/integrations/test_integration_forge.py Removes trailing whitespace on blank lines in tests.
tests/integrations/test_integration_devin.py Ensures file ends with newline / removes EOF formatting noise.
tests/integrations/test_integration_cursor_agent.py Removes trailing whitespace at EOF.
tests/hooks/TESTING.md Removes trailing whitespace in documentation.
tests/hooks/.specify/extensions.yml Removes trailing whitespace in YAML fixture.
templates/vscode-settings.json Removes trailing whitespace / ensures proper EOF newline.
templates/commands/tasks.md Removes trailing whitespace in shipped command template frontmatter/body.
templates/commands/specify.md Removes trailing whitespace in shipped command template frontmatter/body.
templates/commands/plan.md Removes trailing whitespace in shipped command template frontmatter.
templates/commands/implement.md Removes trailing whitespace in shipped command template body.
templates/commands/constitution.md Removes trailing whitespace in shipped command template frontmatter.
templates/commands/clarify.md Removes trailing whitespace in shipped command template frontmatter.
templates/checklist-template.md Removes trailing whitespace in shipped template comments.
src/specify_cli/integrations/forge/__init__.py Removes trailing whitespace in docstring/comments.
src/specify_cli/integrations/devin/__init__.py Ensures proper EOF newline.
spec-kit.code-workspace Ensures proper EOF newline.
scripts/powershell/setup-plan.ps1 Removes trailing whitespace in hashtable/object literal formatting.
scripts/powershell/common.ps1 Removes trailing whitespace on blank line.
scripts/powershell/check-prerequisites.ps1 Removes trailing whitespace and normalizes spacing in output blocks.
scripts/bash/setup-plan.sh Removes trailing whitespace and ensures proper EOF newline.
scripts/bash/create-new-feature.sh Removes trailing whitespace on blank lines.
scripts/bash/check-prerequisites.sh Removes trailing whitespace on help/output spacing.
pyproject.toml Removes trailing whitespace at EOF.
newsletters/2026-March.md Removes trailing blank lines at EOF.
LICENSE Removes trailing whitespace at EOF.
extensions/selftest/commands/selftest.md Removes trailing whitespace in documentation.
extensions/catalog.json Ensures proper EOF newline.
docs/.gitignore Removes trailing whitespace at EOF.
.markdownlint-cli2.jsonc Ensures proper EOF newline.
.github/workflows/stale.yml Removes trailing whitespace in workflow YAML.
.github/PULL_REQUEST_TEMPLATE.md Removes trailing whitespace at EOF.
.github/ISSUE_TEMPLATE/preset_submission.yml Removes trailing whitespace in YAML template.
.github/ISSUE_TEMPLATE/extension_submission.yml Removes trailing whitespace in YAML template.
.github/ISSUE_TEMPLATE/agent_request.yml Removes trailing whitespace in YAML template.
.github/CODEOWNERS Removes trailing whitespace at EOF.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 11/42 changed files
  • Comments generated: 0
  • Review effort level: Low

@mnriem mnriem merged commit c8ce488 into github:main Jul 10, 2026
12 checks passed
@mnriem

mnriem commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Thank you!

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