Show More
@@ -1,5 +1,5 b'' | |||
|
1 | 1 | #require black |
|
2 | 2 | |
|
3 | 3 | $ cd $RUNTESTDIR/.. |
|
4 | $ black --config=black.toml --check --diff `hg files 'set:**.py - mercurial/thirdparty/** - "contrib/python-zstandard/**"'` | |
|
4 | $ black --config=black.toml --check --diff `hg files 'set:(**.py + grep("^#!.*python")) - mercurial/thirdparty/** - "contrib/python-zstandard/**"'` | |
|
5 | 5 |
@@ -1,25 +1,26 b'' | |||
|
1 | 1 | #require test-repo |
|
2 | 2 | |
|
3 | 3 | $ . "$TESTDIR/helpers-testrepo.sh" |
|
4 | 4 | $ cd "`dirname "$TESTDIR"`" |
|
5 | 5 | |
|
6 | 6 | look for python scripts that do not use /usr/bin/env |
|
7 | 7 | |
|
8 | 8 | $ testrepohg files 'set:grep(r"^#!.*?python") and not grep(r"^#!/usr/bi{1}n/env python") - **/*.t' |
|
9 | 9 | [1] |
|
10 | 10 | |
|
11 | 11 | In tests, enforce $PYTHON and *not* /usr/bin/env python or similar: |
|
12 | 12 | $ testrepohg files 'set:grep(r"#!.*?python") and **/*.t' \ |
|
13 | 13 | > -X tests/test-check-execute.t \ |
|
14 | > -X tests/test-check-format.t \ | |
|
14 | 15 | > -X tests/test-check-module-imports.t \ |
|
15 | 16 | > -X tests/test-check-pyflakes.t \ |
|
16 | 17 | > -X tests/test-check-shbang.t |
|
17 | 18 | [1] |
|
18 | 19 | |
|
19 | 20 | The above exclusions are because they're looking for files that |
|
20 | 21 | contain Python but don't end in .py - please avoid adding more. |
|
21 | 22 | |
|
22 | 23 | look for shell scripts that do not use /bin/sh |
|
23 | 24 | |
|
24 | 25 | $ testrepohg files 'set:grep(r"^#!.*/bi{1}n/sh") and not grep(r"^#!/bi{1}n/sh")' |
|
25 | 26 | [1] |
General Comments 0
You need to be logged in to leave comments.
Login now