Questions tagged [pre-commit]

Pre-commit is an action taken prior to committing your code into a version control system.

A pre-commit is an action that would be applied to source code before it is committed to the version control system. To utilize a pre-commit action you'll need to install a pre-commit hook into the repository. Pre-commit hooks are available in most commonly used version control systems such as SVN or git.

Some actions that could be achieved using pre-commit hooks:

  1. Fixing case issues in file names
  2. Validating file content, such as executing a linter or code convention checker.
  3. Preventing specific users from committing code

pre-commit is also the name of a framework for managing such hooks for git.

406 questions
-2
votes
1 answer

How to have a better code to pass the pre-commit check?

I have such code in python 3.7, as : try: import json except ImportError: import simplejson as json And once I am running pre-commit, I have received such failure: testcase.py:57: error: Name 'json' already defined (by an import) my…
user3595231
  • 711
  • 12
  • 29
1 2 3
27
28