Mercurial > hg
annotate tests/test-module-imports.t @ 26965:1fa66d3ad28d
import-checker: reset context to verify convention in function scope
I got the following error by rewriting hgweb/webcommands.py to use
absolute_import. It is false-positive because the import line appears in
"help" function:
hgweb/webcommands.py:1297: higher-level import should come first: mercurial
This patch makes the import checker aware of the function scope and apply
rules recursively.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 01 Nov 2015 17:42:03 +0900 |
parents | 5abba2c92da3 |
children | 69308357ecd1 |
rev | line source |
---|---|
23894
f388ceae2250
test-module-imports: use test-repo requirement
Matt Mackall <mpm@selenic.com>
parents:
22947
diff
changeset
|
1 #require test-repo |
f388ceae2250
test-module-imports: use test-repo requirement
Matt Mackall <mpm@selenic.com>
parents:
22947
diff
changeset
|
2 |
20039
05626e87489c
test-module-imports.t: new test to use the import cycle detector
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
3 $ import_checker="$TESTDIR"/../contrib/import-checker.py |
23894
f388ceae2250
test-module-imports: use test-repo requirement
Matt Mackall <mpm@selenic.com>
parents:
22947
diff
changeset
|
4 |
20039
05626e87489c
test-module-imports.t: new test to use the import cycle detector
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
5 Run the doctests from the import checker, and make sure |
05626e87489c
test-module-imports.t: new test to use the import cycle detector
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
6 it's working correctly. |
05626e87489c
test-module-imports.t: new test to use the import cycle detector
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
7 $ TERM=dumb |
05626e87489c
test-module-imports.t: new test to use the import cycle detector
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
8 $ export TERM |
05626e87489c
test-module-imports.t: new test to use the import cycle detector
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
9 $ python -m doctest $import_checker |
05626e87489c
test-module-imports.t: new test to use the import cycle detector
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
10 |
25703
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
11 Run additional tests for the import checker |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
12 |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
13 $ mkdir testpackage |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
14 |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
15 $ cat > testpackage/multiple.py << EOF |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
16 > from __future__ import absolute_import |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
17 > import os, sys |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
18 > EOF |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
19 |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
20 $ cat > testpackage/unsorted.py << EOF |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
21 > from __future__ import absolute_import |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
22 > import sys |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
23 > import os |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
24 > EOF |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
25 |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
26 $ cat > testpackage/stdafterlocal.py << EOF |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
27 > from __future__ import absolute_import |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
28 > from . import unsorted |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
29 > import os |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
30 > EOF |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
31 |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
32 $ cat > testpackage/requirerelative.py << EOF |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
33 > from __future__ import absolute_import |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
34 > import testpackage.unsorted |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
35 > EOF |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
36 |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
37 $ cat > testpackage/importalias.py << EOF |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
38 > from __future__ import absolute_import |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
39 > import ui |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
40 > EOF |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
41 |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
42 $ cat > testpackage/relativestdlib.py << EOF |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
43 > from __future__ import absolute_import |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
44 > from .. import os |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
45 > EOF |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
46 |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
47 $ cat > testpackage/symbolimport.py << EOF |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
48 > from __future__ import absolute_import |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
49 > from .unsorted import foo |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
50 > EOF |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
51 |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
52 $ cat > testpackage/latesymbolimport.py << EOF |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
53 > from __future__ import absolute_import |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
54 > from . import unsorted |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
55 > from mercurial.node import hex |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
56 > EOF |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
57 |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
58 $ cat > testpackage/multiplegroups.py << EOF |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
59 > from __future__ import absolute_import |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
60 > from . import unsorted |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
61 > from . import more |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
62 > EOF |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
63 |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
64 $ mkdir testpackage/subpackage |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
65 $ cat > testpackage/subpackage/levelpriority.py << EOF |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
66 > from __future__ import absolute_import |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
67 > from . import foo |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
68 > from .. import parent |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
69 > EOF |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
70 |
26964
5abba2c92da3
import-checker: allow import of child modules from package root
Yuya Nishihara <yuya@tcha.org>
parents:
26956
diff
changeset
|
71 $ touch testpackage/subpackage/foo.py |
5abba2c92da3
import-checker: allow import of child modules from package root
Yuya Nishihara <yuya@tcha.org>
parents:
26956
diff
changeset
|
72 $ cat > testpackage/subpackage/__init__.py << EOF |
5abba2c92da3
import-checker: allow import of child modules from package root
Yuya Nishihara <yuya@tcha.org>
parents:
26956
diff
changeset
|
73 > from __future__ import absolute_import |
5abba2c92da3
import-checker: allow import of child modules from package root
Yuya Nishihara <yuya@tcha.org>
parents:
26956
diff
changeset
|
74 > from . import levelpriority # should not cause cycle |
5abba2c92da3
import-checker: allow import of child modules from package root
Yuya Nishihara <yuya@tcha.org>
parents:
26956
diff
changeset
|
75 > EOF |
5abba2c92da3
import-checker: allow import of child modules from package root
Yuya Nishihara <yuya@tcha.org>
parents:
26956
diff
changeset
|
76 |
26965
1fa66d3ad28d
import-checker: reset context to verify convention in function scope
Yuya Nishihara <yuya@tcha.org>
parents:
26964
diff
changeset
|
77 $ cat > testpackage/subpackage/localimport.py << EOF |
1fa66d3ad28d
import-checker: reset context to verify convention in function scope
Yuya Nishihara <yuya@tcha.org>
parents:
26964
diff
changeset
|
78 > from __future__ import absolute_import |
1fa66d3ad28d
import-checker: reset context to verify convention in function scope
Yuya Nishihara <yuya@tcha.org>
parents:
26964
diff
changeset
|
79 > from . import foo |
1fa66d3ad28d
import-checker: reset context to verify convention in function scope
Yuya Nishihara <yuya@tcha.org>
parents:
26964
diff
changeset
|
80 > def bar(): |
1fa66d3ad28d
import-checker: reset context to verify convention in function scope
Yuya Nishihara <yuya@tcha.org>
parents:
26964
diff
changeset
|
81 > # should not cause "higher-level import should come first" |
1fa66d3ad28d
import-checker: reset context to verify convention in function scope
Yuya Nishihara <yuya@tcha.org>
parents:
26964
diff
changeset
|
82 > from .. import unsorted |
1fa66d3ad28d
import-checker: reset context to verify convention in function scope
Yuya Nishihara <yuya@tcha.org>
parents:
26964
diff
changeset
|
83 > # but other errors should be detected |
1fa66d3ad28d
import-checker: reset context to verify convention in function scope
Yuya Nishihara <yuya@tcha.org>
parents:
26964
diff
changeset
|
84 > from .. import more |
1fa66d3ad28d
import-checker: reset context to verify convention in function scope
Yuya Nishihara <yuya@tcha.org>
parents:
26964
diff
changeset
|
85 > import testpackage.subpackage.levelpriority |
1fa66d3ad28d
import-checker: reset context to verify convention in function scope
Yuya Nishihara <yuya@tcha.org>
parents:
26964
diff
changeset
|
86 > EOF |
1fa66d3ad28d
import-checker: reset context to verify convention in function scope
Yuya Nishihara <yuya@tcha.org>
parents:
26964
diff
changeset
|
87 |
25703
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
88 $ cat > testpackage/sortedentries.py << EOF |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
89 > from __future__ import absolute_import |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
90 > from . import ( |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
91 > foo, |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
92 > bar, |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
93 > ) |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
94 > EOF |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
95 |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
96 $ cat > testpackage/importfromalias.py << EOF |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
97 > from __future__ import absolute_import |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
98 > from . import ui |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
99 > EOF |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
100 |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
101 $ cat > testpackage/importfromrelative.py << EOF |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
102 > from __future__ import absolute_import |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
103 > from testpackage.unsorted import foo |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
104 > EOF |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
105 |
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
106 $ python "$import_checker" testpackage/*.py testpackage/subpackage/*.py |
26956
4b56214ebb7a
import-checker: include lineno in warning message
Yuya Nishihara <yuya@tcha.org>
parents:
25989
diff
changeset
|
107 testpackage/importalias.py:2: ui module must be "as" aliased to uimod |
4b56214ebb7a
import-checker: include lineno in warning message
Yuya Nishihara <yuya@tcha.org>
parents:
25989
diff
changeset
|
108 testpackage/importfromalias.py:2: ui from testpackage must be "as" aliased to uimod |
4b56214ebb7a
import-checker: include lineno in warning message
Yuya Nishihara <yuya@tcha.org>
parents:
25989
diff
changeset
|
109 testpackage/importfromrelative.py:2: import should be relative: testpackage.unsorted |
4b56214ebb7a
import-checker: include lineno in warning message
Yuya Nishihara <yuya@tcha.org>
parents:
25989
diff
changeset
|
110 testpackage/importfromrelative.py:2: direct symbol import from testpackage.unsorted |
4b56214ebb7a
import-checker: include lineno in warning message
Yuya Nishihara <yuya@tcha.org>
parents:
25989
diff
changeset
|
111 testpackage/latesymbolimport.py:3: symbol import follows non-symbol import: mercurial.node |
4b56214ebb7a
import-checker: include lineno in warning message
Yuya Nishihara <yuya@tcha.org>
parents:
25989
diff
changeset
|
112 testpackage/multiple.py:2: multiple imported names: os, sys |
4b56214ebb7a
import-checker: include lineno in warning message
Yuya Nishihara <yuya@tcha.org>
parents:
25989
diff
changeset
|
113 testpackage/multiplegroups.py:3: multiple "from . import" statements |
4b56214ebb7a
import-checker: include lineno in warning message
Yuya Nishihara <yuya@tcha.org>
parents:
25989
diff
changeset
|
114 testpackage/relativestdlib.py:2: relative import of stdlib module |
4b56214ebb7a
import-checker: include lineno in warning message
Yuya Nishihara <yuya@tcha.org>
parents:
25989
diff
changeset
|
115 testpackage/requirerelative.py:2: import should be relative: testpackage.unsorted |
4b56214ebb7a
import-checker: include lineno in warning message
Yuya Nishihara <yuya@tcha.org>
parents:
25989
diff
changeset
|
116 testpackage/sortedentries.py:2: imports from testpackage not lexically sorted: bar < foo |
4b56214ebb7a
import-checker: include lineno in warning message
Yuya Nishihara <yuya@tcha.org>
parents:
25989
diff
changeset
|
117 testpackage/stdafterlocal.py:3: stdlib import follows local import: os |
4b56214ebb7a
import-checker: include lineno in warning message
Yuya Nishihara <yuya@tcha.org>
parents:
25989
diff
changeset
|
118 testpackage/subpackage/levelpriority.py:3: higher-level import should come first: testpackage |
26965
1fa66d3ad28d
import-checker: reset context to verify convention in function scope
Yuya Nishihara <yuya@tcha.org>
parents:
26964
diff
changeset
|
119 testpackage/subpackage/localimport.py:7: multiple "from .. import" statements |
1fa66d3ad28d
import-checker: reset context to verify convention in function scope
Yuya Nishihara <yuya@tcha.org>
parents:
26964
diff
changeset
|
120 testpackage/subpackage/localimport.py:8: import should be relative: testpackage.subpackage.levelpriority |
26956
4b56214ebb7a
import-checker: include lineno in warning message
Yuya Nishihara <yuya@tcha.org>
parents:
25989
diff
changeset
|
121 testpackage/symbolimport.py:2: direct symbol import from testpackage.unsorted |
4b56214ebb7a
import-checker: include lineno in warning message
Yuya Nishihara <yuya@tcha.org>
parents:
25989
diff
changeset
|
122 testpackage/unsorted.py:3: imports not lexically sorted: os < sys |
25731
cd1daab5d036
import-checker.py: exit with code 0 if no error is detected
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25703
diff
changeset
|
123 [1] |
25703
1a6a117d0b95
import-checker: establish modern import convention
Gregory Szorc <gregory.szorc@gmail.com>
parents:
25498
diff
changeset
|
124 |
20039
05626e87489c
test-module-imports.t: new test to use the import cycle detector
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
125 $ cd "$TESTDIR"/.. |
05626e87489c
test-module-imports.t: new test to use the import cycle detector
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
126 |
05626e87489c
test-module-imports.t: new test to use the import cycle detector
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
127 There are a handful of cases here that require renaming a module so it |
05626e87489c
test-module-imports.t: new test to use the import cycle detector
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
128 doesn't overlap with a stdlib module name. There are also some cycles |
05626e87489c
test-module-imports.t: new test to use the import cycle detector
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
129 here that we should still endeavor to fix, and some cycles will be |
05626e87489c
test-module-imports.t: new test to use the import cycle detector
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
130 hidden by deduplication algorithm in the cycle detector, so fixing |
05626e87489c
test-module-imports.t: new test to use the import cycle detector
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
131 these may expose other cycles. |
05626e87489c
test-module-imports.t: new test to use the import cycle detector
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
132 |
25176
665a9deae8dd
tests: check import cycles in hgext/**.py, too
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25174
diff
changeset
|
133 $ hg locate 'mercurial/**.py' 'hgext/**.py' | sed 's-\\-/-g' | python "$import_checker" - |
665a9deae8dd
tests: check import cycles in hgext/**.py, too
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25174
diff
changeset
|
134 Import cycle: hgext.largefiles.basestore -> hgext.largefiles.localstore -> hgext.largefiles.basestore |
25731
cd1daab5d036
import-checker.py: exit with code 0 if no error is detected
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25703
diff
changeset
|
135 [1] |