##// END OF EJS Templates
formatting: drop `grey`, our custom black version...
marmoute -
r43665:daa3b589 stable
parent child Browse files
Show More
@@ -1,17 +1,16 b''
1 [tool.black]
1 [tool.black]
2 line-length = 80
2 line-length = 80
3 exclude = '''
3 exclude = '''
4 build/
4 build/
5 | wheelhouse/
5 | wheelhouse/
6 | dist/
6 | dist/
7 | packages/
7 | packages/
8 | \.hg/
8 | \.hg/
9 | \.mypy_cache/
9 | \.mypy_cache/
10 | \.venv/
10 | \.venv/
11 | mercurial/thirdparty/
11 | mercurial/thirdparty/
12 | hgext/fsmonitor/pywatchman/
12 | hgext/fsmonitor/pywatchman/
13 | contrib/python-zstandard/
13 | contrib/python-zstandard/
14 | contrib/grey.py
15 '''
14 '''
16 skip-string-normalization = true
15 skip-string-normalization = true
17 quiet = true
16 quiet = true
@@ -1,87 +1,86 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)
25 Skipping contrib/packaging/hgpackaging/downloads.py it has no-che?k-code (glob)
24 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)
25 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)
26 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)
27 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)
28 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)
29 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)
30 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)
31 Skipping i18n/polib.py it has no-che?k-code (glob)
33 Skipping mercurial/statprof.py it has no-che?k-code (glob)
32 Skipping mercurial/statprof.py it has no-che?k-code (glob)
34 Skipping tests/badserverext.py it has no-che?k-code (glob)
33 Skipping tests/badserverext.py it has no-che?k-code (glob)
35
34
36 @commands in debugcommands.py should be in alphabetical order.
35 @commands in debugcommands.py should be in alphabetical order.
37
36
38 >>> import re
37 >>> import re
39 >>> commands = []
38 >>> commands = []
40 >>> with open('mercurial/debugcommands.py', 'rb') as fh:
39 >>> with open('mercurial/debugcommands.py', 'rb') as fh:
41 ... for line in fh:
40 ... for line in fh:
42 ... m = re.match(br"^@command\('([a-z]+)", line)
41 ... m = re.match(br"^@command\('([a-z]+)", line)
43 ... if m:
42 ... if m:
44 ... commands.append(m.group(1))
43 ... commands.append(m.group(1))
45 >>> scommands = list(sorted(commands))
44 >>> scommands = list(sorted(commands))
46 >>> for i, command in enumerate(scommands):
45 >>> for i, command in enumerate(scommands):
47 ... if command != commands[i]:
46 ... if command != commands[i]:
48 ... print('commands in debugcommands.py not sorted; first differing '
47 ... print('commands in debugcommands.py not sorted; first differing '
49 ... 'command is %s; expected %s' % (commands[i], command))
48 ... 'command is %s; expected %s' % (commands[i], command))
50 ... break
49 ... break
51
50
52 Prevent adding new files in the root directory accidentally.
51 Prevent adding new files in the root directory accidentally.
53
52
54 $ testrepohg files 'glob:*'
53 $ testrepohg files 'glob:*'
55 .arcconfig
54 .arcconfig
56 .clang-format
55 .clang-format
57 .editorconfig
56 .editorconfig
58 .hgignore
57 .hgignore
59 .hgsigs
58 .hgsigs
60 .hgtags
59 .hgtags
61 .jshintrc
60 .jshintrc
62 CONTRIBUTING
61 CONTRIBUTING
63 CONTRIBUTORS
62 CONTRIBUTORS
64 COPYING
63 COPYING
65 Makefile
64 Makefile
66 README.rst
65 README.rst
67 black.toml
66 black.toml
68 hg
67 hg
69 hgeditor
68 hgeditor
70 hgweb.cgi
69 hgweb.cgi
71 setup.py
70 setup.py
72
71
73 Prevent adding modules which could be shadowed by ancient .so/.dylib.
72 Prevent adding modules which could be shadowed by ancient .so/.dylib.
74
73
75 $ testrepohg files \
74 $ testrepohg files \
76 > mercurial/base85.py \
75 > mercurial/base85.py \
77 > mercurial/bdiff.py \
76 > mercurial/bdiff.py \
78 > mercurial/diffhelpers.py \
77 > mercurial/diffhelpers.py \
79 > mercurial/mpatch.py \
78 > mercurial/mpatch.py \
80 > mercurial/osutil.py \
79 > mercurial/osutil.py \
81 > mercurial/parsers.py \
80 > mercurial/parsers.py \
82 > mercurial/zstd.py
81 > mercurial/zstd.py
83 [1]
82 [1]
84
83
85 Keep python3 tests sorted:
84 Keep python3 tests sorted:
86 $ sort < contrib/python3-whitelist > $TESTTMP/py3sorted
85 $ sort < contrib/python3-whitelist > $TESTTMP/py3sorted
87 $ cmp contrib/python3-whitelist $TESTTMP/py3sorted || echo 'Please sort passing tests!'
86 $ cmp contrib/python3-whitelist $TESTTMP/py3sorted || echo 'Please sort passing tests!'
@@ -1,5 +1,5 b''
1 #require black
1 #require black
2
2
3 $ cd $RUNTESTDIR/..
3 $ cd $RUNTESTDIR/..
4 $ black --config=black.toml --check --diff `hg files 'set:**.py - hgext/fsmonitor/pywatchman/** - mercurial/thirdparty/** - "contrib/python-zstandard/**" - contrib/grey.py'`
4 $ black --config=black.toml --check --diff `hg files 'set:**.py - hgext/fsmonitor/pywatchman/** - mercurial/thirdparty/** - "contrib/python-zstandard/**"'`
5
5
@@ -1,40 +1,39 b''
1 #require test-repo
1 #require test-repo
2
2
3 $ . "$TESTDIR/helpers-testrepo.sh"
3 $ . "$TESTDIR/helpers-testrepo.sh"
4 $ import_checker="$TESTDIR"/../contrib/import-checker.py
4 $ import_checker="$TESTDIR"/../contrib/import-checker.py
5
5
6 $ cd "$TESTDIR"/..
6 $ cd "$TESTDIR"/..
7
7
8 There are a handful of cases here that require renaming a module so it
8 There are a handful of cases here that require renaming a module so it
9 doesn't overlap with a stdlib module name. There are also some cycles
9 doesn't overlap with a stdlib module name. There are also some cycles
10 here that we should still endeavor to fix, and some cycles will be
10 here that we should still endeavor to fix, and some cycles will be
11 hidden by deduplication algorithm in the cycle detector, so fixing
11 hidden by deduplication algorithm in the cycle detector, so fixing
12 these may expose other cycles.
12 these may expose other cycles.
13
13
14 Known-bad files are excluded by -X as some of them would produce unstable
14 Known-bad files are excluded by -X as some of them would produce unstable
15 outputs, which should be fixed later.
15 outputs, which should be fixed later.
16
16
17 $ testrepohg locate 'set:**.py or grep(r"^#!.*?python")' \
17 $ testrepohg locate 'set:**.py or grep(r"^#!.*?python")' \
18 > 'tests/**.t' \
18 > 'tests/**.t' \
19 > -X hgweb.cgi \
19 > -X hgweb.cgi \
20 > -X setup.py \
20 > -X setup.py \
21 > -X contrib/automation/ \
21 > -X contrib/automation/ \
22 > -X contrib/debugshell.py \
22 > -X contrib/debugshell.py \
23 > -X contrib/grey.py \
24 > -X contrib/hgweb.fcgi \
23 > -X contrib/hgweb.fcgi \
25 > -X contrib/packaging/hg-docker \
24 > -X contrib/packaging/hg-docker \
26 > -X contrib/packaging/hgpackaging/ \
25 > -X contrib/packaging/hgpackaging/ \
27 > -X contrib/packaging/inno/ \
26 > -X contrib/packaging/inno/ \
28 > -X contrib/python-zstandard/ \
27 > -X contrib/python-zstandard/ \
29 > -X contrib/win32/hgwebdir_wsgi.py \
28 > -X contrib/win32/hgwebdir_wsgi.py \
30 > -X contrib/perf-utils/perf-revlog-write-plot.py \
29 > -X contrib/perf-utils/perf-revlog-write-plot.py \
31 > -X doc/gendoc.py \
30 > -X doc/gendoc.py \
32 > -X doc/hgmanpage.py \
31 > -X doc/hgmanpage.py \
33 > -X i18n/posplit \
32 > -X i18n/posplit \
34 > -X mercurial/thirdparty \
33 > -X mercurial/thirdparty \
35 > -X tests/hypothesishelpers.py \
34 > -X tests/hypothesishelpers.py \
36 > -X tests/test-check-interfaces.py \
35 > -X tests/test-check-interfaces.py \
37 > -X tests/test-demandimport.py \
36 > -X tests/test-demandimport.py \
38 > -X tests/test-imports-checker.t \
37 > -X tests/test-imports-checker.t \
39 > -X tests/test-verify-repo-operations.py \
38 > -X tests/test-verify-repo-operations.py \
40 > | sed 's-\\-/-g' | "$PYTHON" "$import_checker" -
39 > | sed 's-\\-/-g' | "$PYTHON" "$import_checker" -
@@ -1,53 +1,52 b''
1 #require test-repo
1 #require test-repo
2
2
3 $ . "$TESTDIR/helpers-testrepo.sh"
3 $ . "$TESTDIR/helpers-testrepo.sh"
4 $ cd "$TESTDIR"/..
4 $ cd "$TESTDIR"/..
5
5
6 #if no-py3
6 #if no-py3
7 $ testrepohg files 'set:(**.py)' \
7 $ testrepohg files 'set:(**.py)' \
8 > -X contrib/automation/ \
8 > -X contrib/automation/ \
9 > -X contrib/grey.py \
10 > -X contrib/packaging/hgpackaging/ \
9 > -X contrib/packaging/hgpackaging/ \
11 > -X contrib/packaging/inno/ \
10 > -X contrib/packaging/inno/ \
12 > -X contrib/packaging/wix/ \
11 > -X contrib/packaging/wix/ \
13 > -X hgdemandimport/demandimportpy2.py \
12 > -X hgdemandimport/demandimportpy2.py \
14 > -X mercurial/thirdparty/cbor \
13 > -X mercurial/thirdparty/cbor \
15 > | sed 's|\\|/|g' | xargs "$PYTHON" contrib/check-py3-compat.py
14 > | sed 's|\\|/|g' | xargs "$PYTHON" contrib/check-py3-compat.py
16 contrib/python-zstandard/setup.py not using absolute_import
15 contrib/python-zstandard/setup.py not using absolute_import
17 contrib/python-zstandard/setup_zstd.py not using absolute_import
16 contrib/python-zstandard/setup_zstd.py not using absolute_import
18 contrib/python-zstandard/tests/common.py not using absolute_import
17 contrib/python-zstandard/tests/common.py not using absolute_import
19 contrib/python-zstandard/tests/test_buffer_util.py not using absolute_import
18 contrib/python-zstandard/tests/test_buffer_util.py not using absolute_import
20 contrib/python-zstandard/tests/test_compressor.py not using absolute_import
19 contrib/python-zstandard/tests/test_compressor.py not using absolute_import
21 contrib/python-zstandard/tests/test_compressor_fuzzing.py not using absolute_import
20 contrib/python-zstandard/tests/test_compressor_fuzzing.py not using absolute_import
22 contrib/python-zstandard/tests/test_data_structures.py not using absolute_import
21 contrib/python-zstandard/tests/test_data_structures.py not using absolute_import
23 contrib/python-zstandard/tests/test_data_structures_fuzzing.py not using absolute_import
22 contrib/python-zstandard/tests/test_data_structures_fuzzing.py not using absolute_import
24 contrib/python-zstandard/tests/test_decompressor.py not using absolute_import
23 contrib/python-zstandard/tests/test_decompressor.py not using absolute_import
25 contrib/python-zstandard/tests/test_decompressor_fuzzing.py not using absolute_import
24 contrib/python-zstandard/tests/test_decompressor_fuzzing.py not using absolute_import
26 contrib/python-zstandard/tests/test_estimate_sizes.py not using absolute_import
25 contrib/python-zstandard/tests/test_estimate_sizes.py not using absolute_import
27 contrib/python-zstandard/tests/test_module_attributes.py not using absolute_import
26 contrib/python-zstandard/tests/test_module_attributes.py not using absolute_import
28 contrib/python-zstandard/tests/test_train_dictionary.py not using absolute_import
27 contrib/python-zstandard/tests/test_train_dictionary.py not using absolute_import
29 setup.py not using absolute_import
28 setup.py not using absolute_import
30 #endif
29 #endif
31
30
32 #if py3
31 #if py3
33 $ testrepohg files 'set:(**.py) - grep(pygments)' \
32 $ testrepohg files 'set:(**.py) - grep(pygments)' \
34 > -X hgdemandimport/demandimportpy2.py \
33 > -X hgdemandimport/demandimportpy2.py \
35 > -X hgext/fsmonitor/pywatchman \
34 > -X hgext/fsmonitor/pywatchman \
36 > -X mercurial/cffi \
35 > -X mercurial/cffi \
37 > -X mercurial/thirdparty \
36 > -X mercurial/thirdparty \
38 > | sed 's|\\|/|g' | xargs "$PYTHON" contrib/check-py3-compat.py \
37 > | sed 's|\\|/|g' | xargs "$PYTHON" contrib/check-py3-compat.py \
39 > | sed 's/[0-9][0-9]*)$/*)/'
38 > | sed 's/[0-9][0-9]*)$/*)/'
40 hgext/convert/transport.py: error importing: <*Error> No module named 'svn.client' (error at transport.py:*) (glob) (?)
39 hgext/convert/transport.py: error importing: <*Error> No module named 'svn.client' (error at transport.py:*) (glob) (?)
41 hgext/infinitepush/sqlindexapi.py: error importing: <*Error> No module named 'mysql' (error at sqlindexapi.py:*) (glob) (?)
40 hgext/infinitepush/sqlindexapi.py: error importing: <*Error> No module named 'mysql' (error at sqlindexapi.py:*) (glob) (?)
42 mercurial/scmwindows.py: error importing: <ValueError> _type_ 'v' not supported (error at win32.py:*) (no-windows !)
41 mercurial/scmwindows.py: error importing: <ValueError> _type_ 'v' not supported (error at win32.py:*) (no-windows !)
43 mercurial/win32.py: error importing: <ValueError> _type_ 'v' not supported (error at win32.py:*) (no-windows !)
42 mercurial/win32.py: error importing: <ValueError> _type_ 'v' not supported (error at win32.py:*) (no-windows !)
44 mercurial/windows.py: error importing: <ModuleNotFoundError> No module named 'msvcrt' (error at windows.py:*) (no-windows !)
43 mercurial/windows.py: error importing: <ModuleNotFoundError> No module named 'msvcrt' (error at windows.py:*) (no-windows !)
45 mercurial/posix.py: error importing: <ModuleNotFoundError> No module named 'fcntl' (error at posix.py:*) (windows !)
44 mercurial/posix.py: error importing: <ModuleNotFoundError> No module named 'fcntl' (error at posix.py:*) (windows !)
46 mercurial/scmposix.py: error importing: <ModuleNotFoundError> No module named 'fcntl' (error at scmposix.py:*) (windows !)
45 mercurial/scmposix.py: error importing: <ModuleNotFoundError> No module named 'fcntl' (error at scmposix.py:*) (windows !)
47 #endif
46 #endif
48
47
49 #if py3 pygments
48 #if py3 pygments
50 $ testrepohg files 'set:(**.py) and grep(pygments)' | sed 's|\\|/|g' \
49 $ testrepohg files 'set:(**.py) and grep(pygments)' | sed 's|\\|/|g' \
51 > | xargs "$PYTHON" contrib/check-py3-compat.py \
50 > | xargs "$PYTHON" contrib/check-py3-compat.py \
52 > | sed 's/[0-9][0-9]*)$/*)/'
51 > | sed 's/[0-9][0-9]*)$/*)/'
53 #endif
52 #endif
1 NO CONTENT: file was removed
NO CONTENT: file was removed
This diff has been collapsed as it changes many lines, (4094 lines changed) Show them Hide them
General Comments 0
You need to be logged in to leave comments. Login now