Commit Graph

7 Commits

Author SHA1 Message Date
Phil Cohen
4d35b86799 tests: make seq.py output Unix line endings everywhere
Summary: Otherwise, tests that use seq.py to create files, like test-rebase-inmemory-abort-tool.t,  will end up with different content, and thus commit hashes, on Windows.

Reviewed By: quark-zju

Differential Revision: D8643553

fbshipit-source-id: 8bb533765f3f6bd794aa1f7ccaf754cfbe5c3bfb
2018-06-26 13:05:11 -07:00
Jun Wu
584656dff3 codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).

Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.

Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.

An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.

As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.

Reviewed By: wez, phillco, simpkins, pkaush, singhsrb

Differential Revision: D8173629

fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-25 22:17:29 -07:00
Pulkit Goyal
5bdb7d8262 py3: alias xrange to range in tests/seq.py
Differential Revision: https://phab.mercurial-scm.org/D1560
2017-11-29 08:46:37 +05:30
Robert Stanca
118adb331f py3: use print_function in seq.py 2016-04-02 17:29:38 +03:00
Robert Stanca
e8ea25819f py3: use absolute_import in seq.py 2016-04-02 17:28:35 +03:00
timeless
329c86706d tests: add execute bit and fix shbang line 2015-12-22 11:05:05 +00:00
Matt Harbison
dc4a0aa2d2 tests: introduce 'seq.py' as a portable replacement for 'seq'
OS X 10.6.8 doesn't have it, while 10.10 does.  I'm not sure when it was added.
It may be missing from other platforms as well.

This currently doesn't handle the string manipulation options (-f, -s and -w in
MinGW anyway), since there is currently no need for it.  Since xrange defaults
to starting at 0 instead of 1, and treats the end as exclusive instead of
inclusive, the args need to be extracted instead of doing:

        xrange(*[int(a) for a in sys.argv[1:]])

Therefore, the step might as well be added, even though there is no current use.
2015-03-17 20:59:23 -04:00