Skip to content

Conversation

@maxisbey
Copy link
Contributor

@maxisbey maxisbey commented Nov 10, 2025

This PR adds the end-of-file-fixer hook from pre-commit-hooks to enforce that all files end with a newline character.

Motivation and Context

POSIX standards require text files to end with a newline. Many tools expect this convention, and missing trailing newlines can cause issues with diffs, certain parsers, and shell scripts. This hook automatically ensures all files have proper line endings.

Requested by @Kludex in #1553 (comment)

How Has This Been Tested?

The pre-commit hook was tested by running:

pre-commit run end-of-file-fixer --all-files

The hook successfully identified and fixed 6 files that were missing trailing newlines:

  • .gitattribute
  • Example server __init__.py files
  • Example client configuration files

Breaking Changes

None. This only affects formatting of files to ensure they follow POSIX conventions.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

This adds the end-of-file-fixer hook from pre-commit-hooks to ensure all
files in the repository end with a newline character. This improves POSIX
compliance and prevents issues with certain tools that expect proper line
endings.

The hook automatically fixed several files that were missing trailing
newlines.

Reported-by: Kludex
@maxisbey maxisbey force-pushed the add-end-of-file-fixer branch from 919bb6d to 9c58123 Compare November 10, 2025 22:14
Copy link
Member

@Kludex Kludex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@maxisbey maxisbey merged commit a864840 into main Nov 11, 2025
21 checks passed
@maxisbey maxisbey deleted the add-end-of-file-fixer branch November 11, 2025 13:23
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