tox: Use git directly to check for changes (docs).
We also remove checking for uncommited changes in misc_checks.py, as this usually just is noise.
This commit is contained in:
parent
16ab2ad167
commit
c562fac9cb
@ -40,24 +40,17 @@ def check_git():
|
|||||||
print()
|
print()
|
||||||
return False
|
return False
|
||||||
untracked = []
|
untracked = []
|
||||||
changed = []
|
|
||||||
gitst = subprocess.check_output(['git', 'status', '--porcelain'])
|
gitst = subprocess.check_output(['git', 'status', '--porcelain'])
|
||||||
gitst = gitst.decode('UTF-8').strip()
|
gitst = gitst.decode('UTF-8').strip()
|
||||||
for line in gitst.splitlines():
|
for line in gitst.splitlines():
|
||||||
s, name = line.split(maxsplit=1)
|
s, name = line.split(maxsplit=1)
|
||||||
if s == '??' and name != '.venv/':
|
if s == '??' and name != '.venv/':
|
||||||
untracked.append(name)
|
untracked.append(name)
|
||||||
elif s == 'M':
|
|
||||||
changed.append(name)
|
|
||||||
status = True
|
status = True
|
||||||
if untracked:
|
if untracked:
|
||||||
status = False
|
status = False
|
||||||
utils.print_col("Untracked files:", 'red')
|
utils.print_col("Untracked files:", 'red')
|
||||||
print('\n'.join(untracked))
|
print('\n'.join(untracked))
|
||||||
if changed:
|
|
||||||
status = False
|
|
||||||
utils.print_col("Uncommited changes:", 'red')
|
|
||||||
print('\n'.join(changed))
|
|
||||||
print()
|
print()
|
||||||
return status
|
return status
|
||||||
|
|
||||||
|
3
tox.ini
3
tox.ini
@ -90,10 +90,11 @@ commands =
|
|||||||
|
|
||||||
[testenv:docs]
|
[testenv:docs]
|
||||||
skip_install = true
|
skip_install = true
|
||||||
|
whitelist_externals = git
|
||||||
deps =
|
deps =
|
||||||
-rrequirements.txt
|
-rrequirements.txt
|
||||||
commands =
|
commands =
|
||||||
{[testenv:mkvenv]commands}
|
{[testenv:mkvenv]commands}
|
||||||
{envpython} scripts/src2asciidoc.py
|
{envpython} scripts/src2asciidoc.py
|
||||||
{envpython} scripts/misc_checks.py git
|
git --no-pager diff --exit-code --stat
|
||||||
{envpython} scripts/asciidoc2html.py {posargs}
|
{envpython} scripts/asciidoc2html.py {posargs}
|
||||||
|
Loading…
Reference in New Issue
Block a user