A high-performance tool for fixing line endings. It recursively scans directories and adds missing newlines to the end of text files.
- Ultra-fast: Achieves high-speed processing through parallel execution and minimal I/O
- Smart filtering: Automatic binary file detection based on file extensions
- Safe: Automatically skips binary files
- Efficient: Efficient parallel processing using the Sourcegraph conc library
go install github.com/upamune/eolfmt/cmd/eolfmt@latest
Or build from source:
git clone https://github.com/upamune/eolfmt.git
cd eolfmt
go build -o eolfmt ./cmd/eolfmt
# Process all files in the current directory
eolfmt
# Process specific directories
eolfmt /path/to/directory
# Process multiple paths
eolfmt src/ docs/ tests/
# Show version information
eolfmt -version
.git
node_modules
.idea
target
build
dist
vendor
__pycache__
- Executables:
.exe
,.dll
,.so
,.dylib
- Images:
.png
,.jpg
,.jpeg
,.gif
- Archives:
.pdf
,.zip
,.tar
,.gz
- Compiled:
.pyc
,.class
,.jar
Project Size | File Count | Processing Time |
---|---|---|
Small | 1,000 | < 0.5s |
Medium | 10,000 | < 2s |
Large | 100,000 | < 15s |
# Install dependencies
go mod download
# Build
make build
# Run tests
make test
# Static analysis (revive)
make lint
# Run all checks
make check
- Hard link support: The tool does not currently handle hard links specially. When processing hard-linked files, changes will affect all linked instances.
MIT