1

I would like to find the way for git hook to prevent commit and push if the z-index has been use and the value if below 1000. But I did google for it but I could not find any suitable solution for it.

Do you have any solution for it?

Many thanks in advance

AJ-
  • 1,027
  • 2
  • 13
  • 24

1 Answers1

0

Ideally, that would be a server-side hook, like a pre-receive hook.
That way, you don't have to deploy a hook to all developers: any developer pushing an incorrect file would see their push rejected.
The other approach is a client-side hook, like a pre-commit hook similar to this one

In a pre-receive hook, you can list each file and, if their are CSS, get their content

git show commit:filepath

You can then grep for z-index and check their associated value.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250