add precommit-hook, fix linting errors