Coder Social home page Coder Social logo

kevinmarquesp / committizen_emoji_sh Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 1.0 31 KB

I was anoyed that the cz-emoji tool was written in Javascript and depends on NPM, PNPM or whatever you use to manage your node packages, so I made my own commit cittizen script with emoji support using only bash and some system utilities.

License: MIT License

Shell 100.00%

committizen_emoji_sh's Introduction

CZ

For a long time I used the conventional commits pattern to write my commit messages, and when I heard of the cz-cli and cz-emoji command line utilities I've installed them in that same moment. But the fact that these programs is written in JavaScript and depends on a Node packager manager (npm, pnpm or yarn) always annoyed me – yeah, I know that this make the project cross platform, but I really don't care, just makes the project difficult to setup in multiple OSes. So, I made my own Bash script for that. Hope it's helpful for you as well ❤️.

simplescreenrecorder-2024-08-14_00.02.31.mp4

Documentation

Before anything, this project is meant to run only in Unix-like systems. So, if you're a Windows user, I recommend you to use WSL or ask Chat-GPT to convert the main file (cz.sh) to a .ps1 one and drag that to your path. Anyway...

Installation Process

This program is really small and doesnt has many dependencies, maybe everyting's already installed in your system. But, be sure that you can man the commands bellow before running the application for the first time. If not, search in the package manager of your distro (apt or pacman, for example)

Dependencies list:

Steps to install the script file and ithe types.json file:

git clone https://github.com/kevinmarquesp/cz
mkdir ~/.local/share/cz ~/.local/bin
cp cz/cz.sh ~/.local/bin/cz
cp cz/types.json ~/.local/share/cz/types.json
rm -rf cz

Uninstall

Actually, this script need a types.json file that, if you followed the steps above, will be stored in the ~/.loocal/share/cz directory. It's the only dependency, so you'll need to remove that directory and the script file. Here's the steps for that:

rm ~/.local/bin/cz
rm -rf ~/.local/share/cz

Features Of This Application

This script is just an wrapper around the git commit command, so it expects that you'll execute that inside a Git repository. It'll display a list of commit types with the fzf tool for you to chose one, then will ask you a context (a.k.a. scope of the commit), and the commit message, straight up, simple as that.

The is breaking prompt will put a little ! after the commit type name in the final message. It's useful to know which commits represents moments of the time where the project actually works.

The commit prompt will have a bar with 80 characters long, it's not a rule, but it's a good practice to keep your commit messages short and precise, this bar helps with that.

If you used the -d or --description flags, you'll get another prompt, but this time asking for a better, and longer, description of what your commit does. It' useful when it's a breaking change.

You can always edit the types.json in ~/.local/share/cz/types.json to have custom types. But if you're in a project that has a specific convention you can set a custom commit types JSON file with the options -j or --json.

Also, if your terminal doesn't support emoji characters, you can disable the font display with -N or --no-display-emoji to avoid any crashes or weird invalid font characters. But if you don't want any emoji at all on your commit messages, you can disable the commit message emoji with the -n or --no-emoji options.

Use cz --help for more information.

Tip

If you have a custom alias for your fzf command like I do, this script will push that before running the fzf command. So you can expect a customized good looking fzf prompt if you already have!

committizen_emoji_sh's People

Contributors

kevinmarquesp avatar kitsunesemcalda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

kitsunesemcalda

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.