Show More
@@ -1,36 +1,31 | |||||
1 | #require test-repo |
|
1 | #require test-repo | |
2 |
|
2 | |||
3 | $ . "$TESTDIR/helpers-testrepo.sh" |
|
3 | $ . "$TESTDIR/helpers-testrepo.sh" | |
4 | $ check_code="$TESTDIR"/../contrib/check-code.py |
|
4 | $ check_code="$TESTDIR"/../contrib/check-code.py | |
5 | $ cd "$TESTDIR"/.. |
|
5 | $ cd "$TESTDIR"/.. | |
6 |
|
6 | |||
7 | New errors are not allowed. Warnings are strongly discouraged. |
|
7 | New errors are not allowed. Warnings are strongly discouraged. | |
8 | (The writing "no-che?k-code" is for not skipping this file when checking.) |
|
8 | (The writing "no-che?k-code" is for not skipping this file when checking.) | |
9 |
|
9 | |||
10 |
$ hg locate -X contrib/python-zstandard |
|
10 | $ hg locate -X contrib/python-zstandard -X hgext/fsmonitor/pywatchman | | |
11 | > xargs "$check_code" --warnings --per-file=0 || false |
|
11 | > sed 's-\\-/-g' | xargs "$check_code" --warnings --per-file=0 || false | |
12 | Skipping hgext/fsmonitor/pywatchman/__init__.py it has no-che?k-code (glob) |
|
|||
13 | Skipping hgext/fsmonitor/pywatchman/bser.c it has no-che?k-code (glob) |
|
|||
14 | Skipping hgext/fsmonitor/pywatchman/capabilities.py it has no-che?k-code (glob) |
|
|||
15 | Skipping hgext/fsmonitor/pywatchman/msc_stdint.h it has no-che?k-code (glob) |
|
|||
16 | Skipping hgext/fsmonitor/pywatchman/pybser.py it has no-che?k-code (glob) |
|
|||
17 | Skipping i18n/polib.py it has no-che?k-code (glob) |
|
12 | Skipping i18n/polib.py it has no-che?k-code (glob) | |
18 | Skipping mercurial/httpclient/__init__.py it has no-che?k-code (glob) |
|
13 | Skipping mercurial/httpclient/__init__.py it has no-che?k-code (glob) | |
19 | Skipping mercurial/httpclient/_readers.py it has no-che?k-code (glob) |
|
14 | Skipping mercurial/httpclient/_readers.py it has no-che?k-code (glob) | |
20 | Skipping mercurial/statprof.py it has no-che?k-code (glob) |
|
15 | Skipping mercurial/statprof.py it has no-che?k-code (glob) | |
21 |
|
16 | |||
22 | @commands in debugcommands.py should be in alphabetical order. |
|
17 | @commands in debugcommands.py should be in alphabetical order. | |
23 |
|
18 | |||
24 | >>> import re |
|
19 | >>> import re | |
25 | >>> commands = [] |
|
20 | >>> commands = [] | |
26 | >>> with open('mercurial/debugcommands.py', 'rb') as fh: |
|
21 | >>> with open('mercurial/debugcommands.py', 'rb') as fh: | |
27 | ... for line in fh: |
|
22 | ... for line in fh: | |
28 | ... m = re.match("^@command\('([a-z]+)", line) |
|
23 | ... m = re.match("^@command\('([a-z]+)", line) | |
29 | ... if m: |
|
24 | ... if m: | |
30 | ... commands.append(m.group(1)) |
|
25 | ... commands.append(m.group(1)) | |
31 | >>> scommands = list(sorted(commands)) |
|
26 | >>> scommands = list(sorted(commands)) | |
32 | >>> for i, command in enumerate(scommands): |
|
27 | >>> for i, command in enumerate(scommands): | |
33 | ... if command != commands[i]: |
|
28 | ... if command != commands[i]: | |
34 | ... print('commands in debugcommands.py not sorted; first differing ' |
|
29 | ... print('commands in debugcommands.py not sorted; first differing ' | |
35 | ... 'command is %s; expected %s' % (commands[i], command)) |
|
30 | ... 'command is %s; expected %s' % (commands[i], command)) | |
36 | ... break |
|
31 | ... break |
General Comments 0
You need to be logged in to leave comments.
Login now