New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

commit-prefixer

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

commit-prefixer

Prefix commit messages based on modified files

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

commit-prefixer

Add prefixes to commit messages based on changed files.

Add this script to your prepare-commit-msg

#!/usr/bin/env node
const { addPrefixes } = require('commit-prefixer');

addPrefixes({
    // Point to the root of your repo
	baseDir: `${__dirname}/../..`,
    // A list of prefixes that check for changed files
	prefixes: [
        // Matching all files under the .github directory
        {
            regex: /^.github\/([a-z]+)\/.*$/,
            key: 'ci',
        },
        // Matching all files in subfolders under a project folder.
        // Use the subfolder name as a key
        // e.g. projects/frontend/src/index.ts => (frontend)
		{
			regex: /^projects\/([a-z]+)\/\/.*$/,
			keyIndex: 1,
		},
	],
});

Keywords

FAQs

Package last updated on 27 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc