Commit Graph

1478 Commits

Author SHA1 Message Date
adnrs96 153ad18807 Lint for duplicate ids in templates.
In this commit we enhance our current template linter to detect
duplicate ids and report them during lint checks. html_branches.py
was topped up with a new function build_id_dict for the purpose.

Also the get_tag_info function in same file was updated to parse
ids and classes more robustly in cases of template variables.
split_for_id_and_class function was added to serve this purpose.

Unit tests for both the functions were created under
tests/test_html_branches. Also a directory under tests called
test_template_data was created to hold templates for testing under
newly created functionality.

check_templates was modified to print to console any duplicates
detected.
showell reviewed my commit and helped me out.

Fixes #2950.
2017-01-13 17:00:22 -08:00
hackerkid 510659d402 Add virtualenv activation in .zprofile. 2017-01-13 15:13:44 -08:00
Tim Abbott a64a1de023 lint: Be more permissive with Markdown links. 2017-01-12 16:42:51 -08:00
Steve Howell baef662dcb Add tools/review for reviewing PRs.
This script ensures you are starting on master in a pristine
state, and then it creates a branch called review-NNNN for
PR #NNNN in your local repo, along with some basic stats about
the PR.
2017-01-12 15:26:40 -08:00
Steve Howell 7bd16b3946 dev tools: Diagnose venv problems more clearly.
In tools/diagnose, we now catch an ImportError if
we cannot import django, and we instruct the
devloper about the mostly likely remedies.
2017-01-12 13:46:05 -08:00
Steve Howell 5ec0bc1213 Fix typing import in tools/diagnose. 2017-01-12 10:49:11 -08:00
K.Kanakhin aaf82ae090 documentation-crawler: Check images in help documentation.
This checks both that all images under static/images/help/ are used in
the help documentation, and also that none of the image tags are broken.

- Improve documentation spiders and crawler with spider error state.

Fixes #3070.
2017-01-12 10:02:32 -08:00
JefftheBest1 110398bf36 Fixed typos in test-queue-worker-reload 2017-01-12 04:51:27 -08:00
Tim Abbott 3f8d4193da lint: Fix % comprehensions being used without a tuple. 2017-01-09 11:45:11 -08:00
sinwar 3f350391ce docs: Ban the term realm from user documentation.
Fixes #3031.
2017-01-09 10:58:19 -08:00
Tim Abbott 3a64857a4c lint: Fix long lines not being treated as actual errors.
This led to Travis CI not reporting on line-too-long errors.
2017-01-08 22:48:27 -08:00
Tim Abbott b54f8b3b14 lint: Fix incorrect line length calculations in Python 2.
Previously, we would incorrectly be counting bytes in Python 2, which
meant lines with unicode characters in them appeared to the linter to
be far longer than they actually were.
2017-01-08 22:46:02 -08:00
Tommy Ip 89dc739856 tools: Fix bare except clause. 2017-01-08 16:22:21 -08:00
Tommy Ip e04afe9bda tools: Fix bare except clause. 2017-01-08 16:22:21 -08:00
Tim Abbott 24df5fbd97 Delete remains of deprecated inject-messages. 2017-01-07 10:53:20 -08:00
AZtheAsian 0dc9ac7dac Delete deprecated iframe-bot. 2017-01-07 10:53:20 -08:00
Tim Abbott e228243723 install-aws-server: Add support for installing zulip.conf. 2017-01-06 21:58:16 -08:00
Tim Abbott c6bdc2130b install-aws-server: secrets enhancements. 2017-01-06 21:57:20 -08:00
Tim Abbott ed0da5f874 install-aws-server: Fix usage output. 2017-01-06 21:57:20 -08:00
Tim Abbott 246bdbd829 update-prod-static: Fix node_modules/.bin being unavailable in prod.
Apparently `manage.py collectstatic` by default strips files starting
with "." from what it collects.  This is a reasonably precaution,
though mostly irrelevant to us, since Zulip primarily runs that as
part of build-release tarball, which runs in a clean directory.

It also breaks our current approach for transferring node_modules to
prod machines via release tarballs; this change fixes that bug.
2017-01-06 20:23:46 -08:00
Tim Abbott 7df44f2e87 minify-js: Auto-detect virtualenv when possible.
Usually, update-prod-static takes care of this, but it's useful for
debugging purposes to be able to rerun this manually.
2017-01-06 19:55:08 -08:00
Tim Abbott 3a3a1872e7 travis: Prevent upgrading oracle-java9-installer.
This fixes a minor performance problem, and also avoids errors when
Oracle's Java installer site is down.
2017-01-06 19:30:16 -08:00
Tim Abbott 0f50ef12f5 scripts: Fix path to install-node. 2017-01-06 16:48:18 -08:00
Tim Abbott e4b065e03a Move tools/setup/install-node to scripts/setup/. 2017-01-06 16:18:29 -08:00
Tim Abbott a39643da61 lint: Require space after likely ends of sentences in help. 2017-01-06 11:18:45 -08:00
Tim Abbott 1262db40ea lint: Check for invalid '!!! warning'. 2017-01-05 15:15:19 -08:00
Tim Abbott 8b839c96d4 lint: Check for long lines in all markdown files in general.
This has a few excludes for cases involving code blocks where it would
have been difficult to clean up.
2017-01-05 15:06:34 -08:00
Tim Abbott bc4a9ff722 lint: Enforce no lines longer than 120 characters in help docs.
This requires some somewhat messy changes to the all-streams macro.
2017-01-05 14:54:04 -08:00
AZtheAsian e8dafcd905 mypy: Add annotations to api/integrations/asana/zulip_asana_mirror. 2017-01-05 11:08:21 -08:00
ausDensk 059b124027 mypy: Annotate /api/integrations/rss/rss-bot.
With a few tweaks by tabbott.
2017-01-04 22:42:11 -08:00
Tim Abbott 0a6d960f37 emoji: Fix graphical artifacts of adjacent emoji in sprite sheet.
We didn't have any margin between the different emoji symbols
previously.
2017-01-04 17:12:23 -08:00
Steve Howell 8655472135 Use zproject.settings in tools/diagnose. 2017-01-04 08:48:54 -08:00
Steve Howell 7029917129 Add check_migrations() to tools/diagnose script. 2017-01-04 07:51:22 -08:00
Steve Howell cd16a26c9a Add check_venv() to tools/diagnose script. 2017-01-04 07:51:22 -08:00
Steve Howell 0fd9f23505 Add tools/diagnose script.
This script does a basic sanity check on a dev environment.
2017-01-04 07:51:22 -08:00
AZtheAsian c155b9162d mypy: Annotate api/integrations/codebase/zulip_codebase_mirror. 2017-01-03 20:23:06 -08:00
Jackson 98ca518461 mypy: Add annotations to api/integrations/basecamp/zulip_basecamp_mirror 2017-01-03 18:34:26 -08:00
Jackson 566d55b7c6 mypy: Annotate api/integrations/hg/zulip-changegroup.py 2017-01-03 11:44:43 -08:00
Rafid Aslam f897cc5a8b tests: Add --force option to `tools/test-all`
Fixes #2996.
2017-01-03 11:42:53 -08:00
Rafid Aslam fdaed99222 tests: Add `--force` option to `tools/test-help-documentation.py` 2017-01-03 11:42:53 -08:00
anirudhjain75 5f4a822655 mypy: Annotate zerver/tests/test_decorators.py. 2017-01-02 08:59:49 -08:00
Sampriti Panda 246ac7cadc mypy: Annotate api/integrations/twitter/twitter-search-bot 2017-01-02 08:01:37 -08:00
Jackson 88da3dea7e mypy: Annotate api/integrations/trac/zulip_trac.py 2016-12-30 20:05:14 -08:00
K.Kanakhin 0d8c18a6dd nagios-plugins: Add websocket checking to nagios message sending test.
- Add websocket client to create connection with SockJS websocket server.
  It contains callback method to launch after connection setup.
- Add '--websocket' parameter to 'check_send_receive_time' script to
  check websocket connection.
- Add testing  websocket connection to production installation checking.
- Add cronjob to launch websocket connection nagios test.

This makes it possible for Zulip Nagios monitoring to check for
problems impacting the websockets sending code path, which is what all
web users use.
2016-12-30 15:36:37 -08:00
Tommy Ip 29c291b981 mypy: Annotate *api/integrations/perforce/zulip_change-commit.py*. 2016-12-30 15:19:34 -08:00
Tim Abbott a0f3f3dfa0 lint: Forbid script tags in handlebars templates. 2016-12-30 12:43:56 -08:00
lonerz 3c1c65eaf8 mypy: Annotate api/integrations/twitter/twitter-bot 2016-12-30 11:40:45 -08:00
Rishi Gupta 52c18e9c9d run-dev: Change provisioning error messages to not reference tests.
Previously, we got the following as a part of the output when running
`tools/run-dev.py` without provisioning:

    It looks like you checked out a branch that has added
    dependencies beyond what you last provisioned.  Your tests
    are likely to fail until you add dependencies by provisioning.

which is a bit confusing.
2016-12-29 16:13:49 -08:00
Tommy Ip 7f187418d4 mypy: Annotate *api/integrations/nagios/nagios-notify-zulip*. 2016-12-28 15:44:47 -08:00
Steve Howell 178b3898d5 Add TODO to deprecated show-last-messages. 2016-12-28 15:17:24 -08:00