zulip/tools/lib
Anders Kaseorg 6988622fe8 ruff: Enable B023 Function definition does not bind loop variable.
Python’s loop scoping is misdesigned, resulting in a very common
gotcha for functions that close over loop variables [1].  The general
problem is so bad that even the Go developers plan to break
compatibility in order to fix the same design mistake in their
language [2].

Enable the Ruff rule function-uses-loop-variable (B023) [3], which
conservatively prohibits functions from binding loop variables at all.

[1] https://docs.python-guide.org/writing/gotchas/#late-binding-closures
[2] https://go.dev/s/loopvar-design
[3] https://beta.ruff.rs/docs/rules/function-uses-loop-variable/

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-11 18:03:45 -07:00
..
__init__.py
capitalization.py sentry: Provide a server-side tunnel. 2023-03-24 15:16:38 -07:00
git-tools.bash lint: Add .bash extension for tools/lib/git-tools.bash. 2021-06-25 09:01:13 -07:00
gitlint_rules.py gitlint-rules: Rename to gitlint_rules. 2023-03-03 18:02:38 -08:00
html_branches.py black: Reformat with Black 23. 2023-02-02 10:40:13 -08:00
pretty_print.py ruff: Enable B023 Function definition does not bind loop variable. 2023-09-11 18:03:45 -07:00
provision.py provision: Add provision support for Fedora 38. 2023-08-22 11:26:29 -07:00
provision_inner.py provision: Disable compilemessages searching for locale directories. 2023-05-03 17:20:16 -07:00
sanity_check.py ruff: Fix PLR1714 Consider merging multiple comparisons. 2023-07-23 15:21:33 -07:00
template_parser.py ruff: Enable B023 Function definition does not bind loop variable. 2023-09-11 18:03:45 -07:00
test_script.py dependencies: Upgrade JavaScript dependencies. 2022-12-07 09:55:05 -08:00
test_server.py run-dev: Drop .py from script name. 2023-03-03 18:02:37 -08:00