Skip to content

🌹 A commit linter with a lot of rice πŸ™

License

Notifications You must be signed in to change notification settings

aljoshare/commala

Repository files navigation

Logo for commala

commala - A commit linter with a lot of rice

GitHub Release GitHub Release Date

Static Badge Static Badge Static Badge Static Badge OpenSSF Scorecard

β€œGo then, there are other commits than these.”
β€” commala, probably

commala is a commit linting tool that ensures that certain standards are met before you merge to keep your git history clean and consistent. commala is part of your Ka-tet, when you walk through the Wastelands of software development.

Example of a commala workflow

Validators

Getting started

If you want to use it on Github, try out the Github Action. You can find an example workflow here. For Gitlab CI/CD, you can copy this example and modify it to your needs.

Configuration

You can configure commala via .commala.yml or command line parameters:

report:
  junit:
    path: commala-junit.xml # --report-junit-path
validate:
  author:
    name:
      enabled: true # --author-name-enabled
      whitelist: [] # --author-name-whitelist
    email:
      enabled: true # --author-email-enabled
      whitelist: [] # --author-email-whitelist
  branch:
    enabled: true # --branch-enabled
    whitelist: [] # --branch-whitelist
  message:
    enabled: true # --message-enabled
    whitelist: [] # --message-whitelist
  signoff:
    enabled: true # --signoff-enabled
    whitelist: [] # --signoff-whitelist

Contributor Whitelists

Commala supports whitelisting specific contributors (by email) to skip validation for their commits. This is useful for automated bot accounts like Dependabot or Renovate that may not follow conventional commit standards.

Each validator can have its own whitelist configured via .commala.yml:

validate:
  branch:
    enabled: true
    whitelist:
      - "dependabot[bot]@users.noreply.github.com"
      - "renovate[bot]@users.noreply.github.com"
  message:
    enabled: true
    whitelist:
      - "dependabot[bot]@users.noreply.github.com"

Or via CLI flags:

commala check HEAD~5 \
  --branch-whitelist="dependabot[bot]@users.noreply.github.com" \
  --message-whitelist="dependabot[bot]@users.noreply.github.com"

How It Works:

  • Commits from whitelisted authors are marked as "skipped" during validation
  • Skipped commits are clearly marked in console output (gray color)
  • JUnit reports include <skipped> elements for whitelisted commits
  • Skipped commits don't count as failures
  • Whitelist matching uses exact email comparison (case-sensitive)

CLI

The commala command is pretty easy. You can run the checks on all commits like this:

commala check

If you want to check all commits, just pass two dots:

commala check ..

If you want to specify the commit to start and check until HEAD, just specify the commit hash followed by two dots:

commala check a1b2c3d4e5f67890abcdef1234567890abcdef12..

If you want to specify the commit to end the check and start from the beginning, just specify the commit hash preceded by two dots:

commala check ..a1b2c3d4e5f67890abcdef1234567890abcdef12

If you want to specify a commit range, just specify two commit hashes with two dots between them:

commala check f725bf88adb76df5c8c576b514def199e20fc6a0..a1b2c3d4e5f67890abcdef1234567890abcdef12

If you want to specify a negative index, just use the swung dash notation:

commala check HEAD~3

Result

To make it easy to use commala as part of a CI/CD job, it will output the result on the command line but also writes the result in JUnit XML format, so that it can be picked up by the source code versioning system of your choice. If one of the checks fails, commala will exit with a non-zero status.

About

🌹 A commit linter with a lot of rice πŸ™

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 2

  •  
  •