mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-14 17:41:45 +04:00
Move get_head_sha into testing since it is only used by tests.
This commit is contained in:
parent
db6e1afc75
commit
94d626691f
5 changed files with 15 additions and 15 deletions
|
|
@ -2,6 +2,7 @@ import jsonschema
|
|||
import os
|
||||
import os.path
|
||||
import shutil
|
||||
from plumbum import local
|
||||
|
||||
|
||||
TESTING_DIR = os.path.abspath(os.path.dirname(__file__))
|
||||
|
|
@ -29,6 +30,11 @@ def copy_tree_to_path(src_dir, dest_dir):
|
|||
shutil.copy(srcname, destname)
|
||||
|
||||
|
||||
def get_head_sha(dir):
|
||||
with local.cwd(dir):
|
||||
return local['git']['rev-parse', 'HEAD']().strip()
|
||||
|
||||
|
||||
def is_valid_according_to_schema(obj, schema):
|
||||
try:
|
||||
jsonschema.validate(obj, schema)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue