##// END OF EJS Templates
black: rename pyproject.toml to black.toml...
Augie Fackler -
r43496:8f89899a default
parent child Browse files
Show More
1 NO CONTENT: file renamed from pyproject.toml to black.toml
NO CONTENT: file renamed from pyproject.toml to black.toml
@@ -1,15 +1,15 b''
1 [fix]
1 [fix]
2 clang-format:command = clang-format --style file -i
2 clang-format:command = clang-format --style file -i
3 clang-format:pattern = (**.c or **.cc or **.h) and not "listfile:contrib/clang-format-ignorelist"
3 clang-format:pattern = (**.c or **.cc or **.h) and not "listfile:contrib/clang-format-ignorelist"
4
4
5 rustfmt:command = rustfmt {rootpath}
5 rustfmt:command = rustfmt {rootpath}
6 rustfmt:pattern = set:**.rs
6 rustfmt:pattern = set:**.rs
7
7
8 # We use black, but currently with
8 # We use black, but currently with
9 # https://github.com/psf/black/pull/826 applied. For now
9 # https://github.com/psf/black/pull/826 applied. For now
10 # contrib/grey.py is our fork of black. You need to pip install
10 # contrib/grey.py is our fork of black. You need to pip install
11 # git+https://github.com/python/black/@d9e71a75ccfefa3d9156a64c03313a0d4ad981e5
11 # git+https://github.com/python/black/@d9e71a75ccfefa3d9156a64c03313a0d4ad981e5
12 # to have the dependencies for grey.
12 # to have the dependencies for grey.
13 #
13 #
14 # black:command = python3.7 contrib/grey.py --quiet --skip-string-normalization -
14 # black:command = python3.7 contrib/grey.py --quiet --config=black.toml --skip-string-normalization -
15 # black:pattern = set:**.py - hgext/fsmonitor/pywatchman/** - mercurial/thirdparty/** - "contrib/python-zstandard/**"
15 # black:pattern = set:**.py - hgext/fsmonitor/pywatchman/** - mercurial/thirdparty/** - "contrib/python-zstandard/**"
@@ -1,87 +1,87 b''
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 $ testrepohg locate \
10 $ testrepohg locate \
11 > -X contrib/python-zstandard \
11 > -X contrib/python-zstandard \
12 > -X hgext/fsmonitor/pywatchman \
12 > -X hgext/fsmonitor/pywatchman \
13 > -X mercurial/thirdparty \
13 > -X mercurial/thirdparty \
14 > | sed 's-\\-/-g' | "$check_code" --warnings --per-file=0 - || false
14 > | sed 's-\\-/-g' | "$check_code" --warnings --per-file=0 - || false
15 Skipping contrib/automation/hgautomation/__init__.py it has no-che?k-code (glob)
15 Skipping contrib/automation/hgautomation/__init__.py it has no-che?k-code (glob)
16 Skipping contrib/automation/hgautomation/aws.py it has no-che?k-code (glob)
16 Skipping contrib/automation/hgautomation/aws.py it has no-che?k-code (glob)
17 Skipping contrib/automation/hgautomation/cli.py it has no-che?k-code (glob)
17 Skipping contrib/automation/hgautomation/cli.py it has no-che?k-code (glob)
18 Skipping contrib/automation/hgautomation/linux.py it has no-che?k-code (glob)
18 Skipping contrib/automation/hgautomation/linux.py it has no-che?k-code (glob)
19 Skipping contrib/automation/hgautomation/pypi.py it has no-che?k-code (glob)
19 Skipping contrib/automation/hgautomation/pypi.py it has no-che?k-code (glob)
20 Skipping contrib/automation/hgautomation/ssh.py it has no-che?k-code (glob)
20 Skipping contrib/automation/hgautomation/ssh.py it has no-che?k-code (glob)
21 Skipping contrib/automation/hgautomation/try_server.py it has no-che?k-code (glob)
21 Skipping contrib/automation/hgautomation/try_server.py it has no-che?k-code (glob)
22 Skipping contrib/automation/hgautomation/windows.py it has no-che?k-code (glob)
22 Skipping contrib/automation/hgautomation/windows.py it has no-che?k-code (glob)
23 Skipping contrib/automation/hgautomation/winrm.py it has no-che?k-code (glob)
23 Skipping contrib/automation/hgautomation/winrm.py it has no-che?k-code (glob)
24 Skipping contrib/grey.py it has no-che?k-code (glob)
24 Skipping contrib/grey.py it has no-che?k-code (glob)
25 Skipping contrib/packaging/hgpackaging/downloads.py it has no-che?k-code (glob)
25 Skipping contrib/packaging/hgpackaging/downloads.py it has no-che?k-code (glob)
26 Skipping contrib/packaging/hgpackaging/inno.py it has no-che?k-code (glob)
26 Skipping contrib/packaging/hgpackaging/inno.py it has no-che?k-code (glob)
27 Skipping contrib/packaging/hgpackaging/py2exe.py it has no-che?k-code (glob)
27 Skipping contrib/packaging/hgpackaging/py2exe.py it has no-che?k-code (glob)
28 Skipping contrib/packaging/hgpackaging/util.py it has no-che?k-code (glob)
28 Skipping contrib/packaging/hgpackaging/util.py it has no-che?k-code (glob)
29 Skipping contrib/packaging/hgpackaging/wix.py it has no-che?k-code (glob)
29 Skipping contrib/packaging/hgpackaging/wix.py it has no-che?k-code (glob)
30 Skipping contrib/packaging/inno/build.py it has no-che?k-code (glob)
30 Skipping contrib/packaging/inno/build.py it has no-che?k-code (glob)
31 Skipping contrib/packaging/wix/build.py it has no-che?k-code (glob)
31 Skipping contrib/packaging/wix/build.py it has no-che?k-code (glob)
32 Skipping i18n/polib.py it has no-che?k-code (glob)
32 Skipping i18n/polib.py it has no-che?k-code (glob)
33 Skipping mercurial/statprof.py it has no-che?k-code (glob)
33 Skipping mercurial/statprof.py it has no-che?k-code (glob)
34 Skipping tests/badserverext.py it has no-che?k-code (glob)
34 Skipping tests/badserverext.py it has no-che?k-code (glob)
35
35
36 @commands in debugcommands.py should be in alphabetical order.
36 @commands in debugcommands.py should be in alphabetical order.
37
37
38 >>> import re
38 >>> import re
39 >>> commands = []
39 >>> commands = []
40 >>> with open('mercurial/debugcommands.py', 'rb') as fh:
40 >>> with open('mercurial/debugcommands.py', 'rb') as fh:
41 ... for line in fh:
41 ... for line in fh:
42 ... m = re.match(br"^@command\('([a-z]+)", line)
42 ... m = re.match(br"^@command\('([a-z]+)", line)
43 ... if m:
43 ... if m:
44 ... commands.append(m.group(1))
44 ... commands.append(m.group(1))
45 >>> scommands = list(sorted(commands))
45 >>> scommands = list(sorted(commands))
46 >>> for i, command in enumerate(scommands):
46 >>> for i, command in enumerate(scommands):
47 ... if command != commands[i]:
47 ... if command != commands[i]:
48 ... print('commands in debugcommands.py not sorted; first differing '
48 ... print('commands in debugcommands.py not sorted; first differing '
49 ... 'command is %s; expected %s' % (commands[i], command))
49 ... 'command is %s; expected %s' % (commands[i], command))
50 ... break
50 ... break
51
51
52 Prevent adding new files in the root directory accidentally.
52 Prevent adding new files in the root directory accidentally.
53
53
54 $ testrepohg files 'glob:*'
54 $ testrepohg files 'glob:*'
55 .arcconfig
55 .arcconfig
56 .clang-format
56 .clang-format
57 .editorconfig
57 .editorconfig
58 .hgignore
58 .hgignore
59 .hgsigs
59 .hgsigs
60 .hgtags
60 .hgtags
61 .jshintrc
61 .jshintrc
62 CONTRIBUTING
62 CONTRIBUTING
63 CONTRIBUTORS
63 CONTRIBUTORS
64 COPYING
64 COPYING
65 Makefile
65 Makefile
66 README.rst
66 README.rst
67 black.toml
67 hg
68 hg
68 hgeditor
69 hgeditor
69 hgweb.cgi
70 hgweb.cgi
70 pyproject.toml
71 setup.py
71 setup.py
72
72
73 Prevent adding modules which could be shadowed by ancient .so/.dylib.
73 Prevent adding modules which could be shadowed by ancient .so/.dylib.
74
74
75 $ testrepohg files \
75 $ testrepohg files \
76 > mercurial/base85.py \
76 > mercurial/base85.py \
77 > mercurial/bdiff.py \
77 > mercurial/bdiff.py \
78 > mercurial/diffhelpers.py \
78 > mercurial/diffhelpers.py \
79 > mercurial/mpatch.py \
79 > mercurial/mpatch.py \
80 > mercurial/osutil.py \
80 > mercurial/osutil.py \
81 > mercurial/parsers.py \
81 > mercurial/parsers.py \
82 > mercurial/zstd.py
82 > mercurial/zstd.py
83 [1]
83 [1]
84
84
85 Keep python3 tests sorted:
85 Keep python3 tests sorted:
86 $ sort < contrib/python3-whitelist > $TESTTMP/py3sorted
86 $ sort < contrib/python3-whitelist > $TESTTMP/py3sorted
87 $ cmp contrib/python3-whitelist $TESTTMP/py3sorted || echo 'Please sort passing tests!'
87 $ cmp contrib/python3-whitelist $TESTTMP/py3sorted || echo 'Please sort passing tests!'
General Comments 0
You need to be logged in to leave comments. Login now