Commit Graph

2219 Commits

Author SHA1 Message Date
Umair Khan
ee6235d716 lint: Add regex to disallow i18n string concatenation.
Fixes #6398
2017-09-06 07:01:43 -07:00
Greg Price
1ab89b1d89 tools/test-all: Split tools/lint to match Travis scripts.
This keeps `test-all` visibly aligned with `travis/frontend` and
`travis/backend`, which helps us keep it substantively aligned.
2017-08-29 15:42:01 -07:00
Tim Abbott
b087886d1c travis: Move i18n and capitalization linters to frontend.
Since these usually result from changes to HTML templates and other
frontend-side things, it seems better to group them with the frontend.

[Tweaked by gnprice in whitespace and comments.]
2017-08-29 15:42:01 -07:00
Tim Abbott
6ef55145f5 travis: Merge the static-analysis build into backend.
[Tweaked by gnprice to leave the use of --linecoverage-report
unmodified for now.]
2017-08-29 15:42:01 -07:00
Tim Abbott
6de77db93f lint: Fix problematic merging of pyflakes stdout/stderr.
We were getting pyflakes lint error output without line numbers like
this:

pyflakes  |     if user_profile.is_realm_admin and
pyflakes  |                                       ^
pyflakes  |

Apparently the cause was that stdout and stderr was getting mixed
badly, creating "unused import"s lines that had the first of that
error (containing the line number) just above.

As a result, printing out the lines of output from pyflakes' merged
stdout/stderr feed looked like this:

b"zproject/settings.py:95: 'from .prod_settings import *' used; unable to detect undefined nameszerver/views/users.py:49:39: invalid syntax\n"

Note the lack of newline in between the end of the first error at
"names" and the start of the second at "zerver".

This appears to be a change in Pyflakes behavior when we switched to
Python 3; probably they're missing a flush() somewhere.
2017-08-29 10:44:50 -07:00
Tim Abbott
130b5847ad pyflakes: Remove now-unnecessary exclude lines. 2017-08-29 10:27:29 -07:00
Tim Abbott
126171cb76 api: Remove root_domain_uri from API page links.
These pages should be references the current server's UI anyway.
2017-08-28 14:13:37 -07:00
Tim Abbott
a0a1fe1512 settings: Rename SERVER_URI to ROOT_DOMAIN_URI.
This should be a lot less confusing.

See #6013 for discussion.
2017-08-28 14:09:28 -07:00
Brock Whittaker
04888101e2 Replace old portico footer with new sectioned one.
This replaces the old footer that has one section with a small list of
items. This expands the footer to have multiple sections.

Actual content tweaked and tagged for i18n by tabbott.
2017-08-28 11:07:02 -07:00
Tim Abbott
b49448de7d message_edit: Eliminat whitespace in recipient row controls.
This is hacky, but I can't figure out another way to do it that
doesn't cause other problems.

Ideally, we'd add some sort of exclude rule to our HTML template
linter so we can check the rest of the file.
2017-08-27 22:18:29 -07:00
Harshit Bansal
e5361b4403 clean_emoji_cache: Expand clean-emoji-cache.
Expands `clean-emoji-cache` so that it can be used in production
environment as well. Also moves it to `scripts/` from `tools/`.
2017-08-27 17:51:24 -07:00
Harshit Bansal
facb5dbe85 zulip_tools.py: Extract generate_sha1sum_emoji().
Given the path of a zulip installation, it returns a hash corresponding
to the emoji infrastructure of that installation.
2017-08-27 17:51:24 -07:00
Harshit Bansal
948cf54ee3 clean-npm-cache: Expand clean-npm-cache.
Expands `clean-npm-cache` so that it can be used in production
environment as well. Also moves it to `scripts/` from `tools/`.
2017-08-27 17:51:24 -07:00
Tim Abbott
90012f8109 find_add_class: Don't check frontend tests. 2017-08-27 14:04:46 -07:00
Tim Abbott
ce1a8bf5b2 find_add_class: Include full path names in error messages. 2017-08-27 14:04:46 -07:00
Tim Abbott
b1d98c1d0f lint: Only run find_add_class when JS files change. 2017-08-27 13:51:06 -07:00
Tim Abbott
79ae262463 lint: Only run check-urls after python files change. 2017-08-27 13:51:06 -07:00
Robert Hönig
3f01907d3b travis: Distribute linting over frontend and backend suites. 2017-08-27 13:51:06 -07:00
Robert Hönig
c5da0ada31 linter: Replace --pep8 with new --frontend/--backend options.
Adds the --frontend and --backend options to replace
--pep8.

Significantly modified by tabbott to use a cleaner framework.
2017-08-27 13:50:53 -07:00
Robert Hönig
2186d53cf5 linter: Migrate lint from optparse to argparse. 2017-08-27 13:18:55 -07:00
Tim Abbott
1560646144 renumber-migrations: Fix construction of new number. 2017-08-27 12:01:06 -07:00
Tim Abbott
96dcb8f745 renumber-migrations: Fix unnecessary prompt.
The tool already knows the answer anyway.

Fixes #6157.
2017-08-27 12:01:06 -07:00
rht
437b2a3146 Update "MacOS" text to "macOS" 2017-08-26 09:00:42 -07:00
neiljp (Neil Pilgrim)
92985f888b mypy: Adjust check of json from github in update-authors-json. 2017-08-25 12:04:15 -07:00
neiljp (Neil Pilgrim)
a059872856 mypy: Clarify xml.find use in build_emoji:code_point_to_file_name_map. 2017-08-25 12:04:15 -07:00
Tim Abbott
4b709de9c9 python3: Remove six.PY2/six.PY3 checks. 2017-08-25 11:06:43 -07:00
Tim Abbott
b8e7369dee mypy: Remove type: ignores not needed in Python 3. 2017-08-25 11:04:20 -07:00
Tim Abbott
b4d698f0db js-dep-visualizer: Report the PNG file as well. 2017-08-25 10:43:37 -07:00
Tim Abbott
3ceba5ef1e test-backend: Require coverage on most webhook integrations. 2017-08-24 11:33:14 -07:00
Yago González
7d5d8ac61e lint: Add rule for spacing inside Handlebars translation tags.
This commit also includes the fixes to make all Handlebars templates
compliant with the new rule.
2017-08-23 13:08:57 -07:00
Yago González
3a4c6f83fc lint: Ban trailing spaces in Handlebars translation tags. 2017-08-23 13:08:57 -07:00
Yago González
aa5f57fda9 lint: Ban leading spaces in Handlebars translation tags. 2017-08-23 13:08:57 -07:00
rht
e455284bb4 requirements: Remove pathlib2.
`pathlib2` is a backport of pathlib to Python 2.x. Ni!
This dependency can be removed since:
- Zulip 1.6.0+git has been on Python 3 nowadays.
  Ekki-ekki-ekki-ptang-zoom-boing.
- As stated in ticket #6211, having this removed, prevents the need to
  have lockfiles for each of 3.4, 3.5, (and maybe 3.6).

This fixes #6211.
2017-08-23 10:00:21 -07:00
Harshit Bansal
3534e328c5 clean-venv-cache: Expand clean-venv-cache tool.
Expands `clean-venv-cache` tool so that it can be used in prod.
Also moves it from `tools/` to `scripts/`.
2017-08-23 00:03:25 -07:00
Tim Abbott
50ad679342 test-backend: Recommend snakeviz over runsnake.
It has support for Python 3.
2017-08-22 15:44:30 -07:00
Tim Abbott
8dff14430e tools: Remove old python 3 compatibility checker.
Now that we've migrated over to Python 3, this tool is no longer required.

Fixes #6217.
2017-08-22 14:58:59 -07:00
Rishi Gupta
b32fe9f2a0 features: Update screenshot and add tool to generate.
This adds a new management command that should make generating or
updating screenshots a bit easier in the future.
2017-08-22 11:32:22 -07:00
rht
0a469fd4c8 requirements: Lock prod.txt instead of its py3_common dependency.
`py3_common.txt` is no longer locked.
2017-08-22 10:10:57 -07:00
rht
80f4ba7a76 requirements: Replace py3_dev.txt with dev_lock.txt. 2017-08-22 10:10:57 -07:00
rht
2be8a793e4 Lock the recursive requirements in dev.txt via pip-compile.
First, all the lines of py3_dev.txt except for mypy.txt are mv-ed to
dev.txt. Then dev_lock.txt is generated from dev.txt to be used by
py3_dev.txt. `click` is removed from moto.txt since it is already a
dependency of several libraries and will appear as an autogenerated
dependency.
2017-08-21 18:24:55 -07:00
rht
6baef37564 requirements: Remove Python 2-specific files. 2017-08-21 18:24:55 -07:00
Steve Howell
c26e000d4e Fix tools/review for python3. 2017-08-17 17:40:24 -04:00
Umair Khan
cec45b0ae5 tools: Add inline string replacer for files. 2017-08-17 09:03:35 -07:00
Greg Price
b8dcac1b42 run-mypy: Stop running mypy --py2.
Also unconditionally use the `mypy` from our virtualenv --
that's how we ensure we use a common version across different
Zulip developers and in CI.

And as a side effect of cutting some Python 2 vs. Python 3 logic,
fix a bug where `--all` was having no effect.
2017-08-16 17:54:43 -07:00
Greg Price
6346861ccd py3: Cut out the build-release-tarball --py3 flag.
This is now redundant, as we've applied this transformation to the
source tree itself.
2017-08-16 17:54:43 -07:00
Greg Price
33430f83eb py3: Rely on the shebang to invoke provision too.
We had been forcing provision to Python 3 in dev.  Now that everything
is Python 3 and the `tools/lib/provision.py` shebang reflects that, we
can just invoke the script directly like everything else.
2017-08-16 17:54:43 -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
Greg Price
b7ec1b55dd py3: Cut Python 2 codepaths from provision. 2017-08-16 17:54:43 -07:00
Greg Price
d968179e54 py3: Stop running on Python 2 in Travis.
This clears the way to dropping logic in lots of places
for supporting Python 2.
2017-08-16 17:54:43 -07:00
Tim Abbott
debfe708d0 test-all: Fix buggy PYTHONWARNINGS invocation.
Shell only sets variables if they're the first thing on a line.
2017-08-16 11:56:24 -07:00