sapling/eden/scm/tests/test-check-code.t
Xavier Deguillard 77f3f239a2 store: replace use of ctreemanifest with small manifest parser
Summary:
The code still took a dependency on Mercurial's old manifest code to parse
manifests. It turns out the manifests have a very simple format that we could
parse directly.

This avoids various copies, conversions, std::list, removes ~1k lines of code,
at the expense of adding ~100 lines of code (some of them being C++
boilerplate).

Reviewed By: fanzeyi

Differential Revision: D25385018

fbshipit-source-id: 90d4cda2b7797584bc48c086d5592a7ecaa05dfc
2020-12-09 08:40:38 -08:00

45 lines
2.2 KiB
Perl

#chg-compatible
#require test-repo
$ . "$TESTDIR/helpers-testrepo.sh"
$ cd "$TESTDIR"/..
New errors are not allowed. Warnings are strongly discouraged.
(The writing "no-che?k-code" is for not skipping this file when checking.)
$ testrepohg files . | egrep -v "^(edenscm/hgext/extlib/pywatchman|lib/cdatapack|lib/third-party|edenscm/mercurial/thirdparty|fb|newdoc|tests|edenscm/mercurial/templates/static|i18n|slides|.*\\.(bin|bindag|hg|pdf|jpg)$)" \
> | sed 's-\\-/-g' > $TESTTMP/files.txt
$ NPROC=`hg debugsh -c 'import multiprocessing; ui.write(str(multiprocessing.cpu_count()))'`
$ cat $TESTTMP/files.txt | PYTHONPATH= xargs -n64 -P $NPROC contrib/check-code.py --warnings --per-file=0 | LC_ALL=C sort
Skipping edenscm/hgext/globalrevs.py it has no-che?k-code (glob)
Skipping edenscm/hgext/hgsql.py it has no-che?k-code (glob)
Skipping edenscm/mercurial/commands/eden.py it has no-che?k-code (glob)
Skipping edenscm/mercurial/httpclient/__init__.py it has no-che?k-code (glob)
Skipping edenscm/mercurial/httpclient/_readers.py it has no-che?k-code (glob)
Skipping edenscm/mercurial/statprof.py it has no-che?k-code (glob)
Skipping lib/clib/convert.h it has no-che?k-code (glob)
Skipping lib/clib/null_test.c it has no-che?k-code (glob)
Skipping lib/clib/sha1.h it has no-che?k-code (glob)
edenscm/hgext/extlib/phabricator/graphql.py:*: use foobar, not foo_bar naming --> ca_bundle = repo.ui.configpath("web", "cacerts") (glob)
edenscm/hgext/extlib/phabricator/graphql.py:*: use foobar, not foo_bar naming --> def scmquery_log( (glob)
edenscm/hgext/hggit/git_handler.py:*: use foobar, not foo_bar naming --> git_renames = {} (glob)
@commands in debugcommands.py should be in alphabetical order.
>>> import re
>>> commands = []
>>> with open('edenscm/mercurial/commands/debug.py', 'rb') as fh:
... for line in fh:
... m = re.match(b"^@command\('([a-z]+)", line)
... if m:
... commands.append(m.group(1))
>>> scommands = list(sorted(commands))
>>> for i, command in enumerate(scommands):
... if command != commands[i]:
... print('commands in debugcommands.py not sorted; first differing '
... 'command is %s; expected %s' % (commands[i], command))
... break