-1

The developers are using visual studio code and they push in their code to azure repos, I want to add pre commit checks which does simple checks like pointing out missing semicolon, trailing whitespace etc

  • Does this answer your question? [git hook scripts in Azure DevOps](https://stackoverflow.com/questions/68998076/git-hook-scripts-in-azure-devops) – danielorn Sep 02 '21 at 10:52

1 Answers1

0

What are the methods to add pre-commit checks before the developer checks in his/her code in Azure repos

git hook(pre commit checks) is not supported by Azure Repo.

git hook can only work on the local server

You need to manually add git hook script to each local repo in Visual Studio Code before check in the code to Azure Repo.

For example:

enter image description here

For more detailed info, you can refer to this blog: Git Hooks Example.

On the other hand, here is a suggestion ticket about the git hooks in Azure Repo. This feature is on Roadmap.

Kevin Lu-MSFT
  • 20,786
  • 3
  • 19
  • 28