Socket
Socket
Sign inDemoInstall

commit-prefixer

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    commit-prefixer

Prefix commit messages based on modified files


Version published
Maintainers
1
Created

Readme

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

Last updated on 27 Apr 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc