npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

git-blame-ignore-revs-linter

v1.1.0

Published

Check for semantic issues in `.git-blame-ignore-revs` -- wrong commit, duplicates, etc.

Downloads

2

Readme

.git-blame-ignore-revs linter

Check for semantic and opinionated issues in Git skip-list formatted files used by git blame --ignore-revs-file.

Usage

  • Through npx

    npx git-blame-ignore-revs-linter
  • Through npm scripts

    npm install -D git-blame-ignore-revs-linter
    {
      "scripts": {
        "check": "git-blame-ignore-revs"
      }
    }
  • Through code

    npm install git-blame-ignore-revs-linter
    import fs from 'fs/promises';
    import { lint } from 'git-blame-ignore-revs-linter';
    await lint(
      dir,
      (await fs.readFile('.git-blame-ignore-revs', 'utf8')).split('\n')
    );

    See src/cli.ts for another code example

Checks

Commit not in repository

A non-existent commit doesn't alter behavior, adds noise to the file, and is likely a mistake. Rebasing previous commits could invalidate commits already in the .git-blame-ignore-revs, for example.

Given a Git history of:

$ git log
commit 6c29e5b0d2f83e03ce2320cd7ea445465e4bfc9f (HEAD -> main)
Author: Dale Cooper <[email protected]>
Date:   Thu Jul 6 21:38:54 2023 -0500

    do something

And a .git-blame-ignore-revs of:

# run formatter
e4ded84c354e6be25aa073bdd3b43e8dc962b1cc

We'd get:

$ npx git-blame-ignore-revs
line 2: not found in repository (e4ded84c354e6be25aa073bdd3b43e8dc962b1cc)
    run formatter

Commit duplicated

A duplicate doesn't alter behavior and adds noise to the file.

Given a Git history of:

$ git log
commit 6c29e5b0d2f83e03ce2320cd7ea445465e4bfc9f (HEAD -> main)
Author: Dale Cooper <[email protected]>
Date:   Thu Jul 6 21:38:54 2023 -0500

    do something

And a .git-blame-ignore-revs of:

# run formatter
71d5077ff1b80cb377dcec30d64c31c78c3accfc
# run formatter again
9b183f9ce24a93cfe1d6b16a3ef0902d9672c121
# something else!
71d5077ff1b80cb377dcec30d64c31c78c3accfc

We'd get:

$ npx git-blame-ignore-revs
line 6: duplicate entry (71d5077ff1b80cb377dcec30d64c31c78c3accfc)

Malformed commit

Given a Git history of:

$ git log
commit 6c29e5b0d2f83e03ce2320cd7ea445465e4bfc9f (HEAD -> main)
Author: Dale Cooper <[email protected]>
Date:   Thu Jul 6 21:38:54 2023 -0500

    do something

And a .git-blame-ignore-revs of:

6c29e5b0d2f83e03ce2320cd7ea445465e4bfc9f
# no go
main
# also a no go
v1.0

We'd get:

$ npx git-blame-ignore-revs
line 3: not a valid commit (main)
line 5: not a valid commit (v1.0)