Skip to content

Commit d3f34a6

Browse files
committed
finesse omissions only to repos with uncommitted added files
1 parent ddfd7b2 commit d3f34a6

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

.appveyor.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ stack: python 3
66

77
environment:
88
PY_DIR: C:\Python37-x64
9-
109

1110
clone_depth: 3
1211

@@ -22,6 +21,6 @@ init:
2221
install:
2322
- gem install github-linguist --no-document
2423
- pip install -e .[tests]
25-
24+
2625
test_script: pytest -rsv
2726

ghlinguist/__init__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,11 @@ def checkrepo(path: Path) -> bool:
4040
return False
4141

4242
# %% detect uncommited (dirty)
43-
ret = subprocess.check_output(['git', 'status', '--porcelain'], cwd=path, universal_newlines=True)
44-
if ret: # non-empty string
43+
ret = subprocess.check_output(['git', 'status', '--porcelain'],
44+
cwd=path, universal_newlines=True)
45+
46+
if ret.startswith('A'): # non-empty string
4547
logging.warning(f'{path} has uncommited changes: \n{ret}\n Linguist only works on files after "git commit"')
46-
return True # yes true, don't need to be too perfectionist
48+
return False
4749

4850
return True

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = ghlinguist
3-
version = 0.9.1
3+
version = 0.9.2
44
author = Michael Hirsch, Ph.D.
55
url = https://github.com/scivision/linguist-python
66
description = simple command-line parser of GitHub Linguist Ruby program.

tests/test_mod.py

100644100755
File mode changed.

0 commit comments

Comments
 (0)