Skip to content

Fix whitespace issues from contributors #701

Description

@jaydrogers

Problem

Many files in the repo have trailing whitespace or no newline at the end of the file. When a contributor's editor cleans these up on save, their PR includes changes to lines they never touched. This makes reviews harder and turns into a back and forth on every PR.

Current state (excluding docs/node_modules and Markdown):

Problem Files
Trailing whitespace 29
Missing final newline 61

Example: #691 changed 2 lines of config but touched 4 files because of whitespace cleanup.

Fix

  1. Clean up once. Strip trailing whitespace and add missing final newlines in src/, scripts/, and .github/. Do this as its own commit on the release branch so it does not mix with real changes.
  2. Add .editorconfig. The repo has none. Most editors honor it, so contributors' editors will follow our rules without extra setup. Use tabs for Caddyfile, spaces elsewhere, and leave Markdown trailing whitespace alone.
  3. Enforce in CI. Add a whitespace check to .github/workflows/service_lint.yml next to actionlint and hadolint. Options: git diff --check against the empty tree, or the editorconfig-checker Docker image, which validates the repo against .editorconfig with no extra config.

Notes

  • Do the cleanup after the current release branch merges to avoid conflicts with open PRs.
  • Mention .editorconfig in the contributing docs.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions