1.2.0 • Published 12 months ago

crlf-phobia v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

CRLF-Phobia

npm.io npm.io

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 # Global
npm i -D crlf-phobia # To hook with unit test locally

Usage:

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.

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

      # Do anything you want

      - name: Run CRLF-Phobia
        run: npx crlf-phobia * .*
1.2.0

12 months ago

1.1.0

12 months ago

1.0.1

2 years ago

1.0.0

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago