Skip to content

Add GitHub Actions workflow to check for trailing spaces - #106

Open
dandye wants to merge 5 commits into
mainfrom
add-trailing-spaces-check
Open

Add GitHub Actions workflow to check for trailing spaces#106
dandye wants to merge 5 commits into
mainfrom
add-trailing-spaces-check

Conversation

@dandye

@dandye dandye commented Jun 26, 2025

Copy link
Copy Markdown
Collaborator

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

@dandye
dandye force-pushed the add-trailing-spaces-check branch from 20b3dfc to 183d670 Compare June 26, 2025 02:16
@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
dandye and others added 3 commits August 30, 2026 02:48
- 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
- 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 force-pushed the add-trailing-spaces-check branch from 0011ed0 to fa72e66 Compare August 30, 2026 02:48
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