zulip/tools
Greg Price f632692188 lint: Fix use of re.match in judging long lines.
The `re.match` function in the Python stdlib is a trap for the unwary,
with surprising and asymmetrical semantics; we should probably add a
lint rule to ban it entirely.  The docstring says:

> Try to apply the pattern at the start of the string, [...]

In other words, it effectively adds a `^` at the start (or `\A`, where
the distinction matters.)  It's bad enough that this differs from what
grep, sed, perl, less, and every other tool I can think of do when
looking for matches to a regex; on top of that, it treats the
beginning of the string differently from the end, for no obvious
reason.  The function that does what the rest of the world understands
by "match against this regex" is `re.search`.

In this case, it's unlikely that anyone intended for comments with
URLs, or `api_url` references, to miss out on their respective
exceptions to the long-line rule if they happen to start after the
first column.  So fix those rules by just switching to `re.search`
with the same pattern.

I think Markdown URL references may have to start at the beginning of
the line, so I've left a `^` there to preserve -- but now make
explicit -- the `re.match` behavior.
2017-11-28 16:23:10 -08:00
..
documentation_crawler docs: Reorganize developer docs to improve navigation. 2017-11-16 09:45:08 -08:00
droplets Document the add_mentor.py tool. 2017-11-28 13:26:59 -08:00
lib Generate custom-icon-webfont on each provision or update-prod-static. 2017-11-20 16:36:49 -08:00
linter_lib lint: Fix use of re.match in judging long lines. 2017-11-28 16:23:10 -08:00
setup build_emoji: Migrate to python3. 2017-11-20 15:30:58 -08:00
tests lint: Fix tools tests. 2017-11-16 13:59:40 -08:00
travis tools: Rewrite `test-locked-requirements` to be more performant. 2017-11-20 15:35:47 -08:00
zulip-export zulip-export: Convert to using argparse from optparse. 2017-11-10 15:54:02 -08:00
README.md docs: Update links to ReadTheDocs to always use https. 2017-11-16 10:59:24 -08:00
__init__.py
build-docs tools: Add wrapper tool 'build-docs' for building documentation. 2017-06-14 20:16:02 -07:00
build-release-tarball build-release-tarball: Improve help/error output. 2017-11-16 22:19:58 -08:00
check-capitalization docs: Update links from codebase to point to ReadTheDocs. 2017-11-16 10:53:49 -08:00
check-css Simplify CSS linter and clean up CSS. 2017-11-13 12:43:43 -08:00
check-frontend-i18n docs: Update links to ReadTheDocs to always use https. 2017-11-16 10:59:24 -08:00
check-issue-labels refactor: Remove six.moves.configparser import. 2017-11-07 10:51:44 -08:00
check-provision check-provision: Replace optparse with argparse. 2017-09-30 09:32:46 -07:00
check-swagger lint: Ban non-unique operationIds in Swagger. 2017-06-26 22:02:26 -04:00
check-templates lint: Fix check-templates handling of team.html. 2017-11-25 09:43:01 -08:00
check-urls tools: Remove print_function. 2017-09-29 15:44:56 -07:00
clean-branches tools: Update clean-branches to clean review branches. 2017-06-01 21:55:33 -07:00
clean-repo clean-repo: Revert optimization to .pyc removal. 2017-07-30 17:24:55 -07:00
commit-message-lint docs: Fix spelling of Travis CI. 2017-07-31 09:36:22 -07:00
commit-msg lint: Check if commit message is not empty before running gitlint. 2017-06-25 11:29:14 -04:00
compile-handlebars-templates tools: Remove print_function. 2017-09-29 15:44:56 -07:00
conf.ini-template Add tool for scanning issues without area labels. 2017-02-03 09:59:35 -08:00
coveragerc coverage: Update pattern for __str__ for new typing syntax. 2017-11-22 12:16:58 -08:00
create-test-api-docs mypy: Any->Call in create_single_page() in create-test-api-docs. 2017-10-11 12:16:50 -07:00
deploy-branch
deployment-lock-ctl
diagnose requirements: Rename requirements files. 2017-11-21 02:38:26 +05:30
django-template-graph
do-destroy-rebuild-database test_fixtures: Move test_db_status state under UUID_VAR_PATH. 2017-10-17 21:15:58 -07:00
do-destroy-rebuild-test-database
fetch-pull-request tools: Add script to see PRs as authors intended. 2017-06-01 21:55:08 -07:00
fetch-rebase-pull-request git tools: Make error messages more clear. 2017-05-08 10:51:59 -07:00
find-add-class tools: Remove print_function. 2017-09-29 15:44:56 -07:00
find-unused-css
generate-custom-icon-webfont Generate custom-icon-webfont on each provision or update-prod-static. 2017-11-20 16:36:49 -08:00
get-handlebar-vars tools: Remove print_function. 2017-09-29 15:44:56 -07:00
html-grep refactor: Remove six.moves.filter import. 2017-11-07 10:51:44 -08:00
inline-email-css Text-wrap the remaining long lines exceeding 110. 2017-11-15 10:58:03 -08:00
js-dep-visualizer.py tools: Remove print_function. 2017-09-29 15:44:56 -07:00
lint docs: Lint rst files for trailing whitespace. 2017-11-16 13:20:50 -08:00
lister.py Text-wrap the remaining long lines exceeding 110. 2017-11-15 10:58:03 -08:00
minify-js tools: Remove print_function. 2017-09-29 15:44:56 -07:00
munge-postgres-logs tools: Remove `.pl` extension from user script. 2017-10-11 12:52:36 -07:00
optimize-svg tools: Add optimize-svg tool for checking for unoptimized SVG files. 2017-05-30 11:15:56 -07:00
pre-commit linter: Replace --pep8 with new --frontend/--backend options. 2017-08-27 13:50:53 -07:00
pretty-print-html tools: Remove print_function. 2017-09-29 15:44:56 -07:00
provision vagrant: Skip the shell virtualenv warning on provision. 2017-10-27 11:44:47 -07:00
release-tarball-exclude.txt build-release-tarball: Stop using .gitattributes. 2017-10-11 21:51:42 -07:00
renumber-migrations refactor: Remove six.moves.input import. 2017-11-07 10:51:44 -08:00
replace-tarball-shebang tools: Text-wrap long lines exceeding 110. 2017-11-10 16:24:09 -08:00
replacer replacer: Run as script with python 3. 2017-10-05 10:07:54 -07:00
reset-to-pull-request git tools: Make error messages more clear. 2017-05-08 10:51:59 -07:00
review tools: Remove print_function. 2017-09-29 15:44:56 -07:00
run-dev-queue-processors tools: Remove absolute_import in most tools. 2017-09-29 12:28:43 -07:00
run-dev.py refactor: Remove six.moves.urllib.parse import. 2017-11-07 10:51:44 -08:00
run-mypy requirements: Upgrade mypy to 0.550. 2017-11-25 10:06:27 -08:00
send-github-payloads json: Replace most use of simplejson with json. 2017-10-11 22:55:35 -07:00
setup-git-repo lint: Add checks for commit messages using gitlint. 2017-04-21 13:45:12 -07:00
show-profile-results mypy: Remove ignores for a few typeshed bugs fixed upstream. 2017-10-27 17:09:00 -07:00
start-dockers
stop-run-dev tools: Consistently use hyphen in user script names. 2017-10-11 12:52:36 -07:00
sync-translations tools: Add new script to sync translations. 2017-10-05 23:07:16 -07:00
test-all tools: Remove `.py` extensions from user scripts. 2017-10-11 12:52:36 -07:00
test-all-docker
test-api test-api: Fix tests to work with subdomains. 2017-10-02 13:31:22 -07:00
test-backend test-backend: Don't use monkey-patching to set formatter class. 2017-11-21 21:55:48 -08:00
test-documentation test-documentation: Build docs in parallel. 2017-11-17 11:06:56 -08:00
test-help-documentation test-help-documentation: Pass use_db=True. 2017-11-16 13:44:53 -08:00
test-js-with-casper
test-js-with-node test-js-with-node: Port from optparse to argparse. 2017-11-10 15:52:43 -08:00
test-locked-requirements tools: Rewrite `test-locked-requirements` to be more performant. 2017-11-20 15:35:47 -08:00
test-migrations two_factor: Add configuration and URLs. 2017-11-28 15:21:40 -08:00
test-queue-worker-reload actions: Mark all messages as read when user unsubscribes from stream. 2017-11-21 20:09:17 -08:00
test-run-dev py3: Remove "from six.moves import range". 2017-10-17 23:28:14 -07:00
test-tools tools: Remove print_function. 2017-09-29 15:44:56 -07:00
update-authors-json /team: Use list instead of dict for contributors data. 2017-11-22 11:33:24 -08:00
update-locked-requirements requirements: Rename requirements files. 2017-11-21 02:38:26 +05:30
update-prod-static Generate custom-icon-webfont on each provision or update-prod-static. 2017-11-20 16:36:49 -08:00
webpack tools: Remove absolute_import in most tools. 2017-09-29 12:28:43 -07:00
webpack.assets.json help: Merge api.js and help.js bundles to fix code blocks. 2017-10-30 22:53:17 -07:00
webpack.config.ts webpack: jQuery and underscore should be compilied normally to make errors readable. 2017-08-05 19:53:56 -07:00
zanitizer
zanitizer_config.pm.sample

README.md

This directory contains scripts that are used in building, managing, testing, and other forms of work in a Zulip development environment. Note that tools that are also useful in production belong in scripts/ or should be Django management commands.

For more details, see https://zulip.readthedocs.io/en/latest/overview/directory-structure.html.