before-hack-local-variables-hook is a variable defined in `files.el'.
Its value is

  • This variable may be risky if used as a file-local variable.

Normal hook run before setting file-local variables.
It is called after checking for unsafe/risky variables and
setting `file-local-variables-alist', and before applying the
variables stored in `file-local-variables-alist'. A hook
function is allowed to change the contents of this alist.

This hook is called only if there is at least one file-local
variable to set.