Mercurial > hg
view tests/test-check-jshint.t @ 38162:bdf344aea0ee
extensions: peek command table of disabled extensions without importing
With chg where demandimport disabled, and if disk cache not warm, it took
more than 5 seconds to get "unknown command" error when you typo a command
name. This is horrible UX.
The new implementation is less accurate than the original one as Python
can do anything at import time and cmdtable may be imported from another
module, but I think it's good enough.
Note that the new implementation has to parse .py files, which is slightly
slower than executing .pyc if demandimport is enabled.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Thu, 03 May 2018 18:38:02 +0900 |
parents | 45a816361926 |
children |
line wrap: on
line source
#require test-repo jshint hg10 $ . "$TESTDIR/helpers-testrepo.sh" run jshint on all tracked files ending in .js except vendored dependencies $ cd "`dirname "$TESTDIR"`" $ testrepohg locate 'set:**.js' \ > 2>/dev/null \ > | xargs jshint