Skip to content

Commit 0b8258c

Browse files
committed
---
yaml --- r: 177779 b: refs/heads/snap-stage3 c: 7cabb21 h: refs/heads/master i: 177777: fe127bc 177775: 2b61b2c v: v3
1 parent f639a25 commit 0b8258c

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
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 474b324eda10440d6568ef872a7307d38e7de95b
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 1db2039f52a0d6ccb69986058aacddacfb9ba333
4+
refs/heads/snap-stage3: 7cabb2124e9771a0791cba44078ccc8541523935
55
refs/heads/try: fde4472848b662a4d1236388c4cf15e2450237e6
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/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)