Skip to content

fix: ignores section in .commitlintrc.yaml fails validation #4188

Closed
@ddeepwell

Description

@ddeepwell

Steps to Reproduce

Using a `.commitlintrc.yaml` file containing:

extends:
  - "@commitlint/config-angular"
rules:
  type-enum:
    - 2
    - always
    - - build
      - ci
      - docs
      - feat
      - fix
      - perf
      - refactor
      - test
      - release
      - revert
ignores:
  - commit => commit.includes('WIP')
help: |
  **Possible types**:
  `build`:    Changes that affect the build system or external dependencies
  `ci`:       Changes to our CI configuration files and scripts
  `docs`:     Documentation only changes
  `feat`:     A new feature
  `fix`:      A bug fix
  `perf`:     A code change that improves performance
  `refactor`: A code change that neither fixes a bug nor adds a feature
  `test`:     Adding missing tests or correcting existing tests

run commitlint.

Many iterations on the format of `ignores` have been attempted to convince commitlint that the input is a function, but have had no success.

Current Behavior

Running commitlint with a yaml configuration file with an ignores section raises the error:

Error: Commitlint configuration in /path/to/.commitlintrc.yaml is invalid:
	- "/ignores/0" should be a function. Value: "commit => commit.includes('WIP')".

Expected Behavior

It appears I have an incorrect format for the .commitlintrc.yaml file, but am unaware of what the correct format should be, nor have I found the documentation regarding this for yaml files.

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Possible Solution

Improve documentation?

Context

No response

commitlint --version

19.5.0

git --version

2.45.2

node --version

v22.10.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions