Skip to content

Commit 8eec82f

Browse files
committed
---
yaml --- r: 177075 b: refs/heads/auto c: 7cabb21 h: refs/heads/master i: 177073: b3b8c6f 177071: 991444a v: v3
1 parent 333d647 commit 8eec82f

File tree

2 files changed

+23
-15
lines changed

2 files changed

+23
-15
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: 1db2039f52a0d6ccb69986058aacddacfb9ba333
13+
refs/heads/auto: 7cabb2124e9771a0791cba44078ccc8541523935
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/etc/tidy.py

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,45 @@
88
# option. This file may not be copied, modified, or distributed
99
# except according to those terms.
1010

11-
import sys, fileinput, subprocess, re, os
11+
import sys
12+
import fileinput
13+
import subprocess
14+
import re
15+
import os
1216
from licenseck import *
1317
import snapshot
1418

15-
err=0
16-
cols=100
17-
cr_flag="ignore-tidy-cr"
18-
tab_flag="ignore-tidy-tab"
19-
linelength_flag="ignore-tidy-linelength"
19+
err = 0
20+
cols = 100
21+
cr_flag = "ignore-tidy-cr"
22+
tab_flag = "ignore-tidy-tab"
23+
linelength_flag = "ignore-tidy-linelength"
2024

2125
# Be careful to support Python 2.4, 2.6, and 3.x here!
22-
config_proc=subprocess.Popen([ "git", "config", "core.autocrlf" ],
23-
stdout=subprocess.PIPE)
24-
result=config_proc.communicate()[0]
26+
config_proc = subprocess.Popen(["git", "config", "core.autocrlf"],
27+
stdout=subprocess.PIPE)
28+
result = config_proc.communicate()[0]
29+
30+
true = "true".encode('utf8')
31+
autocrlf = result.strip() == true if result is not None else False
2532

26-
true="true".encode('utf8')
27-
autocrlf=result.strip() == true if result is not None else False
2833

2934
def report_error_name_no(name, no, s):
3035
global err
3136
print("%s:%d: %s" % (name, no, s))
32-
err=1
37+
err = 1
38+
3339

3440
def report_err(s):
3541
report_error_name_no(fileinput.filename(), fileinput.filelineno(), s)
3642

43+
3744
def report_warn(s):
3845
print("%s:%d: %s" % (fileinput.filename(),
3946
fileinput.filelineno(),
4047
s))
4148

49+
4250
def do_license_check(name, contents):
4351
if not check_license(name, contents):
4452
report_error_name_no(name, 1, "incorrect license")
@@ -81,13 +89,13 @@ def do_license_check(name, contents):
8189
date, rev = snapshot.curr_snapshot_rev()
8290
if not hsh.startswith(rev):
8391
report_err("snapshot out of date (" + date
84-
+ "): " + line)
92+
+ "): " + line)
8593
else:
8694
if "SNAP" in line:
8795
report_warn("unmatched SNAP line: " + line)
8896

8997
if check_tab and ('\t' in line and
90-
"Makefile" not in fileinput.filename()):
98+
"Makefile" not in fileinput.filename()):
9199
report_err("tab character")
92100
if check_cr and not autocrlf and '\r' in line:
93101
report_err("CR character")

0 commit comments

Comments
 (0)