Use lefthook git hook to run linters and guards

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Problem

The monolith recently started using lefthook, a git hook, to perform pre-commit checks. This helps lower cycle times by running linters and also performing some guards prior to running a CI pipeline.

Proposal

Investigate ways lefthook could be used for API Security.

  1. Perform linting
    1. yamllint
    2. flake8 (python)
  2. Guards
    1. Changed .gitlab-ci.e2e-template.yml, but not .gitlab-ci.e2e-generated.yml

Implementation:

  1. Have our hook install/upgrade the needed dependencies to work (zero friction)
  2. Add lefthook and create configuration
  3. Test on Linux, OS X, and Windows
Edited by 🤖 GitLab Bot 🤖