Skip to content

Conversation

dandye
Copy link
Collaborator

@dandye dandye commented Jun 26, 2025

Summary

Changes Made

  • New workflow: .github/workflows/check-trailing-spaces.yml

    • Runs on all pull requests (opened, synchronized, reopened)
    • Checks Python, Markdown, JSON, YAML, and other text files
    • Provides clear error messages showing which files have trailing spaces
    • Includes helpful commands to fix trailing spaces
  • Documentation update: Updated CONTRIBUTING file

    • Added section about automated code quality checks
    • Provides instructions for removing trailing spaces

Test Plan

  • Validated YAML syntax of the workflow file
  • Tested file detection logic
  • Verified workflow triggers are appropriate for PR checks
  • Will be automatically tested when this PR is created

Benefits

  • Prevents trailing spaces from being committed, reducing unnecessary Git diffs
  • Maintains consistent code formatting across the repository
  • Provides clear feedback to contributors about formatting issues
  • Automated enforcement reduces manual review burden

Fixes #104

- Add check-trailing-spaces.yml workflow that runs on pull requests
- Only checks lines that were added/modified in the PR using git diff -U0
- Checks Python, Markdown, JSON, YAML, and other text files
- Provides clear error messages and fix instructions for changed lines
- Update CONTRIBUTING guide with code quality requirements

Fixes #104
@dandye dandye force-pushed the add-trailing-spaces-check branch from 20b3dfc to 183d670 Compare June 26, 2025 02:16
- Clarify that trailing spaces check only applies to changed lines using git diff -U0
- Remove suggestion to fix entire files to avoid unrelated changes
- Add command to see which changed lines have trailing spaces
- Add note explaining the focused approach
@dandye dandye requested a review from emeryray2002 June 26, 2025 02:31
@dandye dandye added the enhancement New feature or request label Jun 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add GitHub status check to prevent trailing spaces in code

1 participant