Getting Started
Getting started with using Crisp is very straight-forward and not very involved in any way! To get started with using Crisp for your requirements, you have the following options:
- Use as a Pre-Commit hook (RECOMMENDED).
- Use as a standalone tool, either built from source or downloaded using a package manager (Homebrew, APT and so on) (docs are WIP, hence contributions are welcome).
- Use in a CI environment (docs are WIP, hence contributions are welcome).
The following sections of the documentations will walk you through the various ways to get started with using Crisp.
Pre-Commit Hook
The easiest and most straight-forward approach for using Crisp is to utilise it as a Pre-Commit hook. So, the following steps will help you with the process:
-
Ensure Pre-Commit is locally installed and accessible (following the official installation guidelines).
-
Create a
.pre-commit-config.yaml
file with the following contents:repos:- repo: https://github.com/Weburz/crisprev: "v0.1.5"hooks:- id: crisp -
Setup the hooks for your project by executing:
Terminal window pre-commit install --install-hooks -
To test out whether Crisp is working as part of your Pre-Commit hooks, try adding a dummy commit like so:
Terminal window touch .gitkeepgit add .gitkeepgit commit -m 'chore: added a dummy .gitkeep file'
If Crisp was setup properly, you will see either a passing/failing message on STDOUT. If the output is a failing message then your commit message obviously does not follow the Conventional Commits specifications and you will have to improve it accordingly.
Install Using a Package Manager
Crisp can also be used as a standalone tool, installed using your OS’s package manager of choice. Hence, this section of the docs will walk you through the process of getting started with its usage accordingly.
Crisp is available on all major platforms including some of the major Linux distributions, MacOS and Windows. To get Crisp through your preferred choice of package manager on the platform you are using, follow the relevant instructions provided below:
Linux
TBA
TBA
TBA
MacOS
TBA
Windows
TBA
TBA
TBA
Post installation, run the following command to test whether Crisp was installed appropriately and is usable;
crisp version
The command above should print useful build information relevant to the platform you are using Crisp on which can also prove valuable during debugging sessions if you are facing issues with it.
Build From Source
Crisp can also be built from source and used accordingly. The added benefit of this approach is you will get to the test out the absolute latest functionalities of the tool before they are stabilised and shipped. Follow these steps if you are interested in building Crisp from source code:
-
Clone the source code’s remote repository from our GitHub organisation by invoking:
Terminal window git clone --depth 1 git@github.com:Weburz/crisp -
Ensure you have Go and Task installed. Check it by invoking the following commands:
Terminal window go versionTerminal window task --version -
When you are ready with the build tools, invoke the following build command;
Terminal window task buildThe command will build the executable binary in the
bin
directory. -
Copy the compiled executable binary to a preferred location on the filesystem.
Terminal window mv ./bin/crisp ~/.local/bin/crispTerminal window Copy-Item ".\bin\crisp" -Destination "C:\Program Files\Crisp" -
Update your
$PATH
so that the binary is available and executable from any location in the filesystem.To update the
$PATH
, you will have to add the following lines to the.bashrc
/.zshrc
file (only on Linux and MacOS systems):Terminal window export PATH="$PATH:$HOME/.local/bin"Run the following command in a PowerShell session;
Terminal window $ENV:PATH += ";C:\Program Files\Crisp"
Usage in CI Environments
TODO: Add docs on using Crisp to lint PR titles and more