chore: add .pre-commit-config.yaml and fix trailing whitespace#3430
Merged
Conversation
.pre-commit-config.yaml and fix trailing whitespace
Contributor
There was a problem hiding this comment.
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.yamlwith 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
Collaborator
|
Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
.pre-commit-config.yamlwithtrailing-whitespace,end-of-file-fixer,check-yaml, andcheck-executables-have-shebangshooks (excluding.lock.ymlfiles 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 causemanaged-files-modifiedwarnings in user projects when their own pre-commit hooks clean up these issues afterspecify init.Changes
.pre-commit-config.yaml— prevents future trailing whitespace/newline regressionsWhy
Users with pre-commit hooks (
trailing-whitespace,end-of-file-fixer) getspecify integration statuswarnings about modified managed files because the shipped templates contain trailing whitespace that pre-commit correctly strips, causing checksum mismatches.