pre commit function