zulip/scripts/lib
Anders Kaseorg 69730a78cc python: Use trailing commas consistently.
Automatically generated by the following script, based on the output
of lint with flake8-comma:

import re
import sys

last_filename = None
last_row = None
lines = []

for msg in sys.stdin:
    m = re.match(
        r"\x1b\[35mflake8    \|\x1b\[0m \x1b\[1;31m(.+):(\d+):(\d+): (\w+)", msg
    )
    if m:
        filename, row_str, col_str, err = m.groups()
        row, col = int(row_str), int(col_str)

        if filename == last_filename:
            assert last_row != row
        else:
            if last_filename is not None:
                with open(last_filename, "w") as f:
                    f.writelines(lines)

            with open(filename) as f:
                lines = f.readlines()
            last_filename = filename
        last_row = row

        line = lines[row - 1]
        if err in ["C812", "C815"]:
            lines[row - 1] = line[: col - 1] + "," + line[col - 1 :]
        elif err in ["C819"]:
            assert line[col - 2] == ","
            lines[row - 1] = line[: col - 2] + line[col - 1 :].lstrip(" ")

if last_filename is not None:
    with open(last_filename, "w") as f:
        f.writelines(lines)

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-06-11 16:04:12 -07:00
..
third install-yarn: Fix buggy status check for the signature. 2018-04-09 15:09:37 -07:00
__init__.py
build-pgroonga provision: Added provision support for Ubuntu 20.04(Focal). 2020-03-17 14:57:14 -07:00
certbot-maybe-renew certbot: Switch to use certbot from apt. 2020-06-08 21:59:29 -07:00
check_rabbitmq_queue.py python: Use trailing commas consistently. 2020-06-11 16:04:12 -07:00
clean-unused-caches python: Convert function type annotations to Python 3 style. 2020-04-18 20:42:48 -07:00
clean_emoji_cache.py travis: Remove Travis unwanted code. 2020-04-28 11:11:23 -07:00
clean_node_cache.py travis: Remove Travis unwanted code. 2020-04-28 11:11:23 -07:00
clean_venv_cache.py travis: Remove Travis unwanted code. 2020-04-28 11:11:23 -07:00
create-production-venv python: Use trailing commas consistently. 2020-06-11 16:04:12 -07:00
create-thumbor-venv python: Use trailing commas consistently. 2020-06-11 16:04:12 -07:00
email-mirror-postfix python: Use trailing commas consistently. 2020-06-11 16:04:12 -07:00
hash_reqs.py python: Convert function type annotations to Python 3 style. 2020-04-18 20:42:48 -07:00
install install: Ad production support for Zulip on Ubuntu Focal. 2020-05-25 16:58:42 -07:00
install-node install-node: Upgrade Node.js to 12.18.0. 2020-06-07 11:06:57 -07:00
node_cache.py python: Use trailing commas consistently. 2020-06-11 16:04:12 -07:00
pythonrc.py python: Add noqa comments for the specific star imports we allow. 2020-06-11 15:36:43 -07:00
queue_workers.py setup_path_on_import: Replace with setup_path function. 2020-02-25 15:40:21 -08:00
setup-apt-repo provision: switch Focal to use PGroonga from PPA. 2020-03-31 15:02:31 -07:00
setup-apt-repo-debathena Use #!/usr/bin/env for bash shebangs. 2018-12-17 17:21:08 -08:00
setup-yum-repo setup-yum-repo: Update url of postgresql rpm repo. 2020-06-08 11:26:07 -07:00
setup_path.py setup_path: Fix KeyError in setup_path for virtualenv ≥ 20. 2020-03-23 04:06:19 -07:00
setup_venv.py python: Use trailing commas consistently. 2020-06-11 16:04:12 -07:00
sharding.py python: Convert percent formatting to Python 3.6 f-strings. 2020-06-10 15:02:09 -07:00
unpack-zulip python: Convert percent formatting to Python 3.6 f-strings. 2020-06-10 15:02:09 -07:00
upgrade-zulip python: Convert percent formatting to Python 3.6 f-strings. 2020-06-10 15:02:09 -07:00
upgrade-zulip-from-git python: Convert percent formatting to Python 3.6 f-strings. 2020-06-10 15:02:09 -07:00
upgrade-zulip-stage-2 logging: Pass more format arguments to logging. 2020-05-26 11:42:23 -07:00
zulip_tools.py python: Use trailing commas consistently. 2020-06-11 16:04:12 -07:00