#git #linter

app lintje

Lintje is an opinionated linter for Git

14 releases (9 breaking)

Uses new Rust 2021

0.11.0 Sep 11, 2022
0.9.0 Aug 7, 2022
0.7.1 Jun 20, 2022
0.7.0 Mar 15, 2022
0.3.1 Jul 15, 2021

#231 in Development tools

Download history 21/week @ 2022-06-07 11/week @ 2022-06-14 20/week @ 2022-06-21 1/week @ 2022-06-28 10/week @ 2022-07-05 21/week @ 2022-07-12 15/week @ 2022-07-19 34/week @ 2022-07-26 74/week @ 2022-08-02 11/week @ 2022-08-09 5/week @ 2022-08-16 43/week @ 2022-08-23 3/week @ 2022-08-30 32/week @ 2022-09-06 25/week @ 2022-09-13 1/week @ 2022-09-20

64 downloads per month

MIT license

325KB
9K SLoC

Lintje


Lintje is an opinionated linter for Git. It lints commit messages based on a preconfigured set of rules focussed on promoting communication between people. The idea is to write commits meant for other people reading them during reviews and debug sessions 2+ months from now.

  • No configuration. Don't spend time configuring your Git commit linter and instead adopt a preconfigured set of rules.
  • Portable. Lintje is a Rust project built for several Operating Systems and has no dependencies. Drop it into your project and it works.

Documentation

Visit Lintje.dev for more information about Lintje, and the Lintje documentation.

Example

Given the last commit in a project is this:

Fix bug

When running lintje to lint the last commit, the output will be:

$ lintje
Error[SubjectCliche]: The subject does not explain the change in much detail
  9a2ae29:1:1: Fix bug
    |
  1 | Fix bug
    | ^^^^^^^ Describe the change in more detail

Error[MessagePresence]: No message body was found
  9a2ae29:3:1: Fix bug
    |
  1 | Fix bug
  2 |
  3 |
    | ^ Add a message body with context about the change and why it was made

Error[BranchNameTicketNumber]: A ticket number was detected in the branch name
  Branch:1: fix-123
  |
  | fix-123
  | ^^^^^^^ Remove the ticket number from the branch name or expand the branch name with more details

1 commit and branch inspected, 3 errors detected

For more usage examples, see the [usage docs].

Getting help

Need help with Lintje? Found a bug or have a question?

Reach out to me through the issue tracker, discussions, on Twitter @tombruijn (DMs are open) or on any Slack team you can find me on.

Development

Setup

Make sure Rust is installed before continuing.

cargo build

Testing

cargo test

Building

Docker is required to build all the different target releases using cross.

To build all different targets, run the build script:

rake build

The build output can be found in the dist/ directory.

Releases

Before release all the supported targets will be build. See Building for more information about the build step.

To release all different targets, run the release script:

rake release

The release will be pushed to GitHub.

Finally update the Lintje Homebrew tap.

Code of Conduct

This project has a Code of Conduct and contributors are expected to adhere to it.

Dependencies

~4.5MB
~96K SLoC