CRLF can cause disaster on your app sometimes.
Run this simple inefficient app to scan your project files and it will warn
you if there is a file with CRLF endings.
This app will ignore files ignored by .gitignore by default if exists, It also ignores binary files. You can add or remove ignore files by using adding .crlfignore to the same level.
npm i -g crlf-phobia # Global
npm i -D crlf-phobia # To hook with unit test locally
crlf-phobia *.cpp # All CPP
crlf-phobia * .* # All Files exclude gitignored (for zsh, for PowerShell idk)
Note: CRLF-Phobia support both shell glob (Glob done by shell before parsing argv into program) and also shipped with glob in case your shell is lazy.
「
I will wipe out every single CRLF from this project.
-
Awful performance: This library check for whole file to make sure not a single CRLF can survive!
-
Can only detect CRLF, because who use CR nowadays?
Run before test:
"test": "crlf-phobia * .* && pnpm real-test"
Run with GitHub Workflow
name: CRLF Phobia
on:
push:
jobs:
main:
name: NO CRLF
runs-on: ubuntu-latest
steps:
- name: actions/checkout
uses: actions/checkout@v3
# Do anything you want
- name: Run CRLF-Phobia
run: npx crlf-phobia * .*