Skip to content
Snippets Groups Projects
Commit 0a7a6e7b authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

[ci][check] correctly change the cwd before running pre-commit

parent 3938a7f4
No related branches found
No related tags found
1 merge request!213Fix nightlies commands
Pipeline #49211 passed
......@@ -89,7 +89,7 @@ def human_time(seconds, granularity=2):
return ", ".join([x for x in result[:granularity] if x is not None])
def run_cmdline(cmd, env=None):
def run_cmdline(cmd, env=None, **kwargs):
"""Runs a command on a environment, logs output and reports status.
Parameters:
......@@ -114,6 +114,7 @@ def run_cmdline(cmd, env=None):
env=env,
bufsize=1,
universal_newlines=True,
**kwargs,
)
for line in iter(p.stdout.readline, ""):
......
......@@ -1023,6 +1023,6 @@ def check(root):
try:
backup = os.environ.get("SKIP", "")
os.environ["SKIP"] = "sphinx-build,sphinx-doctest"
run_cmdline(["python", "-m", "pre_commit", "run", "--all-files"])
run_cmdline(["python", "-m", "pre_commit", "run", "--all-files"], cwd=root)
finally:
os.environ["SKIP"] = backup
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment