|
2 | 2 |
|
3 | 3 | <!-- prettier-ignore-start -->
|
4 | 4 |   
|
| 5 | + |
| 6 | + |
| 7 | + |
5 | 8 | <!-- prettier-ignore-end -->
|
6 | 9 |
|
7 |
| -Crisp is an opinionated linter for |
8 |
| -[`git-commit`](https://git-scm.com/docs/git-commit) messages built on top of the |
9 |
| -[Conventional Commits](https://www.conventionalcommits.org) specifications. It |
10 |
| -is built in response to cater to certain requirements that |
11 |
| -[`commitlint`](https://commitlint.js.org) could not fulfill our needs at |
| 10 | +Crisp is a linter for [git-commit](https://git-scm.com/docs/git-commit) messages |
| 11 | +built on top of [Conventional Commits](https://www.conventionalcommits.org). It |
| 12 | +was built in response to the following requirements we needed at |
12 | 13 | [Weburz](https://weburz.com).
|
13 | 14 |
|
14 |
| -**NOTE**: Crisp is still a **WORK-IN-PROGRESS** project and **IS NOT** |
15 |
| -recommended for usage in production environments yet! |
| 15 | +1. Require a no nonsense and opionionated linter to enforce an uniform and |
| 16 | + standard commit message style guide. |
| 17 | +2. An easy to setup and use binary executable so that we do not have to deal |
| 18 | + with broken Node.js dependencies. |
| 19 | + |
| 20 | +## Usage Guide |
| 21 | + |
| 22 | +There are two primary ways to get started with using Crisp: |
| 23 | + |
| 24 | +1. Using [Pre-Commit](https://pre-commit.com) (**RECOMMENDED**). |
| 25 | +2. Downloading and using the executable binary (check the [releases](./releases) |
| 26 | + page.). |
| 27 | + |
| 28 | +For more detailed usage (and development) guidelines on the project, please |
| 29 | +refer to the project's official documentations here - |
| 30 | +[tech.weburz.com/crisp](https://tech.weburz.com/crisp). |
| 31 | + |
| 32 | +### Using Crisp With Pre-Commit |
| 33 | + |
| 34 | +It is **RECOMMENDED** to use Crisp through Pre-Commit. Follow these instructions |
| 35 | +to use the hook accordingly: |
| 36 | + |
| 37 | +1. Create a `.pre-commit-config.yaml` file and add the following contents to it: |
| 38 | + |
| 39 | + ```yaml |
| 40 | + repos: |
| 41 | + - repo: https://github.com/Weburz/crisp |
| 42 | + rev: <VERSION> |
| 43 | + hooks: |
| 44 | + - id: crisp |
| 45 | + name: lint git-commit messages |
| 46 | + ``` |
| 47 | +
|
| 48 | +2. Install the pre-commit hook in your local Git repository by invoking: |
| 49 | +
|
| 50 | + ```console |
| 51 | + pre-commit install --install-hook |
| 52 | + ``` |
| 53 | + |
| 54 | +3. Thereafter you can either commit some changes to the local Git repository or |
| 55 | + you can directly invoke the hook by running: |
| 56 | + |
| 57 | + ```console |
| 58 | + pre-commit run --all-files --verbose |
| 59 | + ``` |
| 60 | + |
| 61 | +If your Pre-Commit configuration are correct then you will find it invoked and |
| 62 | +linted your commit appropriately. |
| 63 | + |
| 64 | +### Using the Binary Executable |
| 65 | + |
| 66 | +To download, setup and use the executable binary directly on your system, follow |
| 67 | +these instructions: |
| 68 | + |
| 69 | +1. Download the binary from the [releases](./releases) page. |
| 70 | +2. Copy the binary to a location on your filesystem (e.g. `~/.local/bin`) by |
| 71 | + invoking: |
| 72 | + |
| 73 | + ```console |
| 74 | + mv ~/Downloads/crisp ~/.local/bin |
| 75 | + ``` |
| 76 | + |
| 77 | +3. Ensure the path where `crisp` is available is added to `$PATH` by running: |
| 78 | + |
| 79 | + ```console |
| 80 | + echo $PATH |
| 81 | + ``` |
| 82 | + |
| 83 | + If the path you installed `crisp` (e.g. `~/.local/bin`) to is not listed in |
| 84 | + the output above, then you will probably have to edit your `.bashrc` or |
| 85 | + `.zshrc` file to update the `$PATH`. |
16 | 86 |
|
17 | 87 | ## Why Crisp Exists?
|
18 | 88 |
|
19 | 89 | We built Crisp at Weburz due to limitations of `commitlint` which were hampering
|
20 |
| -our development workflows. Hence, with Crisp, we expect to resolve some of those |
21 |
| -concerns and we hope others outside Weburz will be able to make some use of |
22 |
| -Crisp as well! |
23 |
| - |
24 |
| -1. **Unopinionated nature of `commitlint`**: When using `commitlint` for some of |
25 |
| - our projects we realised `commitlint` does not strictly adhere to its |
26 |
| - specifications! It is possible to share custom configurations as `npm` |
27 |
| - packages for everyone else to use. We believe a linter should be strict and |
28 |
| - opionionated, hence Crisp will strictly adhere to the Conventional Commits |
29 |
| - specs sheet! |
30 |
| -2. **Dependency on Node.js**: A minor concern for us when using `commitlint` was |
31 |
| - its dependency on [Node.js](https://nodejs.org) for its runtime. We want our |
32 |
| - CLI tools to be lightweight and be shipped as executable binaries! |
33 |
| -3. **Self-sufficient, lightweight and ease-to-use**: With respect to the |
34 |
| - aforementioned pointers, `commitlint` can be time-consuming and (kind of) |
35 |
| - difficult to use with all its configuration options. We want to make it |
36 |
| - easier to use Crisp so that developers can focus on writing code instead of |
37 |
| - configuring (and debating about) a linter. |
| 90 | +our development workflows. With it, we expect to resolve some of those concerns |
| 91 | +and we hope others outside Weburz will be able to make some use of Crisp as |
| 92 | +well! |
| 93 | + |
| 94 | +1. `commitlint` WAS NOT opionionated enough for our requirements. Neither do we |
| 95 | + want to deal with shareable configurations published on |
| 96 | + [npm registry](https://www.npmjs.com). We expected `commitlint` to strictly |
| 97 | + adhere to the "Conventional Commits" specifications but was deeply |
| 98 | + disappointed. |
| 99 | + |
| 100 | +2. Dependency on Node.js was not something we appreciated due to the reasons |
| 101 | + mentioned above. Among other reasons include, requiring to keep a track of |
| 102 | + dependency updates just for a `git-commit` message linter was not a good use |
| 103 | + of our time. |
| 104 | + |
| 105 | +3. We wanted an easier way to use and ship the tool as an executable binary so |
| 106 | + that our developers can quickly up and running using it instead of bickering |
| 107 | + about messaging style guide. |
38 | 108 |
|
39 | 109 | ## What Crisp isn't?
|
40 | 110 |
|
41 | 111 | Crisp isn't;
|
42 | 112 |
|
43 |
| -1. An enhancement of `commitlint` (even though it is based on its intended specs |
44 |
| - sheet). |
| 113 | +1. An enhancement of `commitlint` (even though it is based on its intended |
| 114 | + specifications). |
| 115 | + |
45 | 116 | 2. It will not have a functionality to comply with the idea of "shareable
|
46 |
| - configurations". |
| 117 | + configurations" although a limited set of configuration options are |
| 118 | + acceptable (PRs are welcome of course! <3). |
| 119 | + |
47 | 120 | 3. A clone of `commitlint` with a similar CLI UI/UX as documented
|
48 |
| - [here in the `commitlint` docs](https://commitlint.js.org/reference/cli.html). |
| 121 | + [the `commitlint` docs](https://commitlint.js.org/reference/cli.html). |
49 | 122 |
|
50 | 123 | ## Usage and Distribution Rights
|
51 | 124 |
|
|
0 commit comments