Giter VIP home page Giter VIP logo

ccommits-scope-builder's Introduction

VSCode CComits Scope Builder ๐Ÿ”Ž

Node script that automatically populates your conventional commit scopes in your repositories .vscode/settings.json file, used by the VSCode CComits extension to help developers in your team create meaningfull commit messages. The script uses the paths of folders, and sub-folders by default to create these scopes.

Quickstart ๐Ÿš€

  • Requires Node v.16 or higher
  1. Copy the index.js file from this repo, and paste it at the root level of your repository.
  2. Execute the script with node index.js

Conventional Commits

Conventional Commits specification is a convention for writing commit messages. It provides a set of rules for creating an explicit commit history, and if used properly, can be used to auto generate changelogs.

How does it work?

The script simply traverses your working directory, stores the names of all folders and sub-folders in a list before iterating over that list and creating an entry for each element in your .vscode/settings.json

Example Project Structure

- .vscode
- front-end
    - components
    - public
- back-end
- random

Given the folder structure above, after placing the script at root level and executing it with node index.js your workspace setting will automatically populate with a list of scope strings.

Example Result: settings.json

The script will write all folder and sub-folder names to the scopes key in your local conventional commit workspace settings after execution.

{
  // .vscode/settings.json
  "conventionalCommits.scopes": [
    "backend",
    "front-end",
    "front-end/components",
    "front-end/public",
    "random",
  ]
}

Example Result: VSCode CComits Extension

CComits VSCode Extension will then be able to auto suggest the scopes generated whenever you use the extension to commit.

image

Why folders as scopes?

Scopes should indicate the module, package, or area of the code that was affected by the changes made in the commit. Rather than using specific file paths, directories feels better to use and are easy to automatically generate.

Roadmap

Option for specifying every file as well as ignoring paths in .gitignore is planned for this script. Feel free to make a PR if you miss any functionality.

ccommits-scope-builder's People

Contributors

arienshibani avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.