mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-15 10:01:46 +04:00
Add simple identify command
This commit is contained in:
parent
120eecaf89
commit
bb2b679ef0
2 changed files with 16 additions and 0 deletions
8
pre_commit/commands/identify.py
Normal file
8
pre_commit/commands/identify.py
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
from pre_commit import git
|
||||
from pre_commit.file_classifier.classifier import classify
|
||||
|
||||
|
||||
def identify(args):
|
||||
# TODO: more useful output
|
||||
# TODO: check whether file is in git repo first?
|
||||
print(classify(args.path, git.guess_git_type_for_file(args.path)))
|
||||
Loading…
Add table
Add a link
Reference in a new issue