Skip to content

Commit 1d10582

Browse files
committed
Revert "Don't complain about \r when core.autocrlf is on in Git"
This reverts commit 828afaa.
1 parent 4727532 commit 1d10582

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/etc/tidy.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
#!/usr/bin/python
22

3-
import sys, fileinput, subprocess
3+
import sys, fileinput
44

55
err=0
66
cols=78
77

8-
config_proc=subprocess.Popen([ "git", "config", "core.autocrlf" ],
9-
stdout=subprocess.PIPE)
10-
result=config_proc.communicate()[0]
11-
autocrlf=result.strip() == b"true" if result is not None else False
12-
138
def report_err(s):
149
global err
1510
print("%s:%d: %s" % (fileinput.filename(), fileinput.filelineno(), s))
@@ -19,11 +14,10 @@ def report_err(s):
1914
if line.find('\t') != -1 and fileinput.filename().find("Makefile") == -1:
2015
report_err("tab character")
2116

22-
if not autocrlf and line.find('\r') != -1:
17+
if line.find('\r') != -1:
2318
report_err("CR character")
2419

25-
line_len = len(line)-2 if autocrlf else len(line)-1
26-
if line_len > cols:
20+
if len(line)-1 > cols:
2721
report_err("line longer than %d chars" % cols)
2822

2923

0 commit comments

Comments
 (0)