commitlint-circle

raw JSON →
1.0.0 verified Fri May 01 auth: no javascript maintenance

Convenience wrapper around @commitlint/cli for linting all relevant commits for a change or PR on Circle CI, version 1.0.0. This package is specifically for Circle CI, providing zero-configuration linting. Its key differentiator is the automatic detection of the commit range based on Circle CI environment variables (e.g., CIRCLE_PULL_REQUESTS, CIRCLE_SHA1). It requires @commitlint/cli ^7.0.0 as a peer dependency. Ship TypeScript types. One of the few commitlint integrations tailored to Circle CI, but note it is not actively maintained (last release in 2019).

error Error: Cannot find module '@commitlint/cli'
cause Missing peer dependency @commitlint/cli
fix
Run npm install @commitlint/cli@^7.0.0 --save-dev or yarn add @commitlint/cli@^7.0.0 --dev
error Error: No commit range found. Are you running on Circle CI?
cause Missing required Circle CI environment variables (e.g., CIRCLE_PULL_REQUESTS, CIRCLE_SHA1)
fix
Ensure you are running inside a Circle CI job, or set the necessary environment variables for testing.
deprecated Package has not been updated since 2019 and may not work with newer versions of @commitlint/cli.
fix Consider using @commitlint/config-conventional directly with commitlint's built-in Circle CI support, or use commitlint GitHub action.
gotcha The package relies on Circle CI environment variables; it will fail silently or with unclear errors if run outside Circle CI.
fix Only run in Circle CI environment; for local testing, set environment variables like CIRCLE_SHA1, CIRCLE_PULL_REQUESTS manually.
gotcha Requires @commitlint/cli@^7.0.0 as peer dependency, which may conflict with newer commitlint versions.
fix Ensure @commitlint/cli version satisfies the peer dependency range (^7.0.0).
npm install commitlint-circle
yarn add commitlint-circle
pnpm add commitlint-circle

Configures Circle CI to run commitlint-circle, which lints all commits in the current build or PR.

// .circleci/config.yml
version: 2.1
orbs:
  node: circleci/node@5.0.0
jobs:
  build:
    executor:
      name: node/default
    steps:
      - checkout
      - node/install-packages:
          pkg-manager: yarn
      - run:
          name: Lint commits
          command: npx commitlint-circle