Created
April 3, 2020 20:05
-
-
Save iafisher/b4c3838cfc7cdb3118e118d2a836b3f3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from iafisher_precommit import Precommit, Problem, checks | |
def main(): | |
precommit = Precommit() | |
# Generic checks | |
precommit.register(checks.NoStagedAndUnstagedChanges()) | |
precommit.register(checks.NoWhiteSpaceInFilePath()) | |
# Python checks | |
precommit.register(checks.PythonFormat()) | |
precommit.register(checks.PythonStyle()) | |
precommit.register(MyCustomCheck()) | |
precommit.run() | |
class MyCustomCheck: | |
def check(self, repo_info, path): | |
if "beef" in path: | |
return Problem("file path is not vegetarian") | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment