Mercurial > hg
annotate tests/test-module-imports.t @ 25661:20de1ace07a9
check-code: detect legacy exception syntax
We just rewrote all files to use modern exception syntax. Ban the old
form.
This will detect the "except type, instance" and
"except (type1, type2), instance" forms.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Tue, 23 Jun 2015 22:20:01 -0700 |
parents | 7a5335ed7e1a |
children | 1a6a117d0b95 |
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 |
05626e87489c
test-module-imports.t: new test to use the import cycle detector
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
11 $ cd "$TESTDIR"/.. |
05626e87489c
test-module-imports.t: new test to use the import cycle detector
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
12 |
05626e87489c
test-module-imports.t: new test to use the import cycle detector
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
13 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
|
14 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
|
15 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
|
16 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
|
17 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
|
18 |
25176
665a9deae8dd
tests: check import cycles in hgext/**.py, too
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25174
diff
changeset
|
19 $ hg locate 'mercurial/**.py' 'hgext/**.py' | sed 's-\\-/-g' | python "$import_checker" - |
20386
a05d31b040d7
import-checker: show stdlib and relative imports separately
Mads Kiilerich <madski@unity3d.com>
parents:
20199
diff
changeset
|
20 mercurial/dispatch.py mixed imports |
a05d31b040d7
import-checker: show stdlib and relative imports separately
Mads Kiilerich <madski@unity3d.com>
parents:
20199
diff
changeset
|
21 stdlib: commands |
a05d31b040d7
import-checker: show stdlib and relative imports separately
Mads Kiilerich <madski@unity3d.com>
parents:
20199
diff
changeset
|
22 relative: error, extensions, fancyopts, hg, hook, util |
a05d31b040d7
import-checker: show stdlib and relative imports separately
Mads Kiilerich <madski@unity3d.com>
parents:
20199
diff
changeset
|
23 mercurial/fileset.py mixed imports |
a05d31b040d7
import-checker: show stdlib and relative imports separately
Mads Kiilerich <madski@unity3d.com>
parents:
20199
diff
changeset
|
24 stdlib: parser |
a05d31b040d7
import-checker: show stdlib and relative imports separately
Mads Kiilerich <madski@unity3d.com>
parents:
20199
diff
changeset
|
25 relative: error, merge, util |
a05d31b040d7
import-checker: show stdlib and relative imports separately
Mads Kiilerich <madski@unity3d.com>
parents:
20199
diff
changeset
|
26 mercurial/revset.py mixed imports |
a05d31b040d7
import-checker: show stdlib and relative imports separately
Mads Kiilerich <madski@unity3d.com>
parents:
20199
diff
changeset
|
27 stdlib: parser |
24722
02a5618e2fbf
revset: don't import discovery at module level
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24487
diff
changeset
|
28 relative: error, hbisect, phases, util |
20386
a05d31b040d7
import-checker: show stdlib and relative imports separately
Mads Kiilerich <madski@unity3d.com>
parents:
20199
diff
changeset
|
29 mercurial/templater.py mixed imports |
a05d31b040d7
import-checker: show stdlib and relative imports separately
Mads Kiilerich <madski@unity3d.com>
parents:
20199
diff
changeset
|
30 stdlib: parser |
20519
cda9d2b6beab
template: add revset() template function
Durham Goode <durham@fb.com>
parents:
20405
diff
changeset
|
31 relative: config, error, templatefilters, templatekw, util |
20386
a05d31b040d7
import-checker: show stdlib and relative imports separately
Mads Kiilerich <madski@unity3d.com>
parents:
20199
diff
changeset
|
32 mercurial/ui.py mixed imports |
a05d31b040d7
import-checker: show stdlib and relative imports separately
Mads Kiilerich <madski@unity3d.com>
parents:
20199
diff
changeset
|
33 stdlib: formatter |
25498
7a5335ed7e1a
progress: move the singleton logic to the ui module
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
25269
diff
changeset
|
34 relative: config, error, progress, scmutil, util |
24487
642d245ff537
import-checker: fix rotatecycle
Matt Mackall <mpm@selenic.com>
parents:
24423
diff
changeset
|
35 Import cycle: mercurial.cmdutil -> mercurial.context -> mercurial.subrepo -> mercurial.cmdutil |
25176
665a9deae8dd
tests: check import cycles in hgext/**.py, too
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25174
diff
changeset
|
36 Import cycle: hgext.largefiles.basestore -> hgext.largefiles.localstore -> hgext.largefiles.basestore |
25174
86298718b01c
import-checker: make imported_modules yield absolute dotted_name_of_path
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25063
diff
changeset
|
37 Import cycle: mercurial.commands -> mercurial.commandserver -> mercurial.dispatch -> mercurial.commands |