Commit Graph

21 Commits

Author SHA1 Message Date
Robert Hönig 83eb22fc2f lister: Make excluding directories work on Windows. 2017-09-27 08:43:53 -07:00
julianasobreira df2d448f7b python: Add lint rule banning 'from os.path import'.
This enforces our use of a consistent style in how we access Python
modules; "from os.path import dirname" is a particularly popular
abbreviation inconsistent with our style, and so it deserves a lint
rule.

Commit message and error text tweaked by tabbott.

Fixes #6543.
2017-09-22 04:55:38 -07:00
Greg Price a099e698e2 py3: Switch almost all shebang lines to use `python3`.
This causes `upgrade-zulip-from-git`, as well as a no-option run of
`tools/build-release-tarball`, to produce a Zulip install running
Python 3, rather than Python 2.  In particular this means that the
virtualenv we create, in which all application code runs, is Python 3.

One shebang line, on `zulip-ec2-configure-interfaces`, explicitly
keeps Python 2, and at least one external ops script, `wal-e`, also
still runs on Python 2.  See discussion on the respective previous
commits that made those explicit.  There may also be some other
third-party scripts we use, outside of this source tree and running
outside our virtualenv, that still run on Python 2.
2017-08-16 17:54:43 -07:00
Robert Hönig 500ec48215 testing: Properly exclude files for linting in Windows.
For files to be excluded in Windows, their paths have to
be normalized, so that the string matching works.
2017-07-25 11:30:58 -07:00
Aditya Bansal 83db0a98ae pep8: Add compliance with rule E261 to lister.py. 2017-05-07 23:21:50 -07:00
sinwar eab355b0cd tools: Create more consistent checks for venv.
This helps make the Zulip development environment somewhat more robust
to new contributors, since it will give them a nice warning if they
try running any of our development tools outside the Zulip virtualenv.

Fixes #3468.
2017-02-06 21:50:32 -08:00
Rafid Aslam 7a2282986a pep8: Fix E225 pep8 violations. 2016-11-28 15:21:15 -08:00
Eklavya Sharma 7bd935bef2 Add option to only show extensionless files in lister. 2016-07-21 16:59:52 +05:30
Greg Price 436499a129 Clean up some relative-path handling in lister using Git magic
This lets us cut out the line which hard-codes how deeply nested in
the tree the `run-mypy` script is, making it simpler to borrow these
scripts in other projects.
2016-05-30 20:01:37 -07:00
Eklavya Sharma bd63caed96 Fix exclude startegy in tools/lister.py.
Previously lister.py used to check whether the exclude path is a
substring of a path being considered.  So it would fail when the
exclude path is an absolute path or uses '..' or '.'.
2016-05-24 13:24:15 -07:00
Eklavya Sharma 27f12b2de3 Annotate tools/lister.py. 2016-05-01 23:04:09 +05:30
Eklavya Sharma 2d3f9c8fb9 tools/lister.py: Use default arguments in add_argument.
Use the `default` parameter of ArgumentParser.add_argument
instead of manually setting default using the `x = x or []` pattern.
2016-05-01 07:01:52 +05:30
Eklavya Sharma be0a4f349d Apply Python 3 futurize transform libmodernize.fixes.fix_filter. 2016-04-05 13:22:51 -07:00
Tim Abbott 70c1b0a01d lister: Add file type detection for node and ruby. 2016-04-01 15:27:32 -07:00
Eklavya Sharma aead933c14 Add command-line interface to lister.py using argparse. 2016-04-01 15:27:32 -07:00
Eklavya Sharma 81fdeae0ea Remove '.'s from extensions in lister.py interface and lint-all.
In lint-all, change occurences of '.py', '.js', ... to 'py', 'js', ....
2016-04-01 15:27:16 -07:00
Eklavya Sharma ec8ae1f4c5 Add option to determine file type in lister.py using shebang. 2016-04-01 15:19:13 -07:00
Eklavya Sharma 5063f16f82 Add options for file type in lister.py
Add option to filter files by their extension.
Add option to return a dict of list of files keyed by their file type.
2016-04-01 15:19:13 -07:00
Eklavya Sharma 81aabb5831 Add option to exclude files from lister.py. 2016-04-01 15:19:13 -07:00
Eklavya Sharma 422fef2e24 Add argument modified_only to lister.py.
Add option of only showing modified files in tools/lister.py.
2016-04-01 15:19:13 -07:00
Eklavya Sharma 6954eb072c Create lister.py.
Make module tools/lister.py which lists all files in a directory
tracked by git.  This is done because lister.py will be used by other
scripts in the future which have to introspect files in the repository,
like linters, static code checkers, etc.
2016-04-01 15:19:13 -07:00