Skip to content

Commitlint working fine for the repo in first cloned directory but not on the new cloned directory or in Azure Repo or in Visual Studio #4206

Open
@bharath2023

Description

@bharath2023

Steps to Reproduce

npm install --save-dev @commitlint/config-conventional @commitlint/cli
echo "export default { extends: ['@commitlint/config-conventional'] };" > commitlint.config.js

npm install --save-dev husky
npx husky init
echo "npx --no -- commitlint --edit \$1" > .husky/commit-msg
npx commitlint --from HEAD~1 --to HEAD --verbose
git commit -m "foo: this will fail"
         Failure - Expected
git commit -m "chore: lint on commitmsg"
         Success - Expce

Current Behavior

  1. First step: Local setup is done for the repo called "devops" by following the official document
    https://commitlint.js.org/guides/local-setup.html.

Hook is working fine within the local cloned working directory called "devops"
Success: It blocks the commits as the message doesn't consist of type - Expected

  1. Second Step: All the code changes like npm nodemodules, husky were pushed to the remote orgin. In other directory - tried cloning the same repo "devops" with all commit lint configs.

Failure: It doesn't block the commit message though the conventional type is missing.

  1. Third Test: Direct commit in Visual studio without the type - Failure
  2. Firth Test: Direct commit in azure repo without the type in mesaage - Failure

Expected Behavior

Error-Commitlint.docx

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Possible Solution

No response

Context

No response

commitlint --version

@commitlint/cli@19.6.0

git --version

git version 2.47.1.windows.1

node --version

10.9.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions