CRLF-Phobia

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.
Installation:
npm i -g crlf-phobia
npm i -D crlf-phobia
Usage:
crlf-phobia *.cpp
crlf-phobia * .*
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.
Q: Isn't there already an npm package that can do this?
A: Yes
Q: So how is yours different?
A: Colors and MEMES
jk, this one is designed with "crlf-phobia" in mind.
「駆逐してやる このプロジェックから、一匹残らず」
I will wipe out every single CRLF from this project.
Limitation
-
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?
Advanced Usage
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
- name: Run CRLF-Phobia
run: npx crlf-phobia * .*