Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
docs: Update Black and isort references to Ruff.
Anders Kaseorge0208784eacc
diff --git a/README.md b/README.mdindex 001499d23d2..1afa5d9b152 100644--- a/README.md+++ b/README.md@@ -18,7 +18,6 @@ Come find us on the [development community chat](https://zulip.com/development-c[](https://codecov.io/gh/zulip/zulip)[][mypy-coverage][](https://github.com/astral-sh/ruff)-[](https://github.com/psf/black)[](https://github.com/prettier/prettier)[](https://github.com/zulip/zulip/releases/latest)[](https://zulip.readthedocs.io/en/latest/)diff --git a/docs/contributing/code-style.md b/docs/contributing/code-style.mdindex ef23a6ecd69..2e512b6ffab 100644--- a/docs/contributing/code-style.md+++ b/docs/contributing/code-style.md@@ -61,9 +61,7 @@ lint checks in parallel, including:- JavaScript ([ESLint](https://eslint.org/),[Prettier](https://prettier.io/))- Python ([mypy](http://mypy-lang.org/),- [ruff](https://github.com/astral-sh/ruff),- [Black](https://github.com/psf/black),- [isort](https://pycqa.github.io/isort/))+ [Ruff](https://docs.astral.sh/ruff/))- templates- Puppet configuration- custom checks (e.g., trailing whitespace and spaces-not-tabs)@@ -139,15 +137,12 @@ rules about integrating third-party projects.## Python-specific conventions and practices- Our Python code is formatted with- [Black](https://github.com/psf/black) and- [isort](https://pycqa.github.io/isort/). The [linter- tool](../testing/linters.md) enforces this by running Black and- isort in check mode, or in write mode with- `tools/lint --only=black,isort --fix`. You may find it helpful to- [integrate Black](https://black.readthedocs.io/en/stable/integrations/editors.html)- and- [isort](https://pycqa.github.io/isort/#installing-isorts-for-your-preferred-text-editor)- with your editor.+ [Ruff](https://docs.astral.sh/ruff/). The [linter+ tool](../testing/linters.md) enforces this by running Ruff in check+ mode, or in write mode with+ `tools/lint --only=ruff,ruff-format --fix`. You may find it helpful+ to [integrate Ruff](https://docs.astral.sh/ruff/integrations/) with+ your editor.- Don't put a shebang line on a Python file unless it's meaningful torun it as a script. (Some libraries can also be run as scripts, e.g.,to run a test suite.)diff --git a/docs/testing/linters.md b/docs/testing/linters.mdindex 952c7c7fccd..6c033f8bf0b 100644--- a/docs/testing/linters.md+++ b/docs/testing/linters.md@@ -23,14 +23,12 @@ prevent common coding errors.We borrow some open source tools for much of our linting, and the linksbelow will direct you to the official documentation for these projects.-- [Black](https://github.com/psf/black)- [ESLint](https://eslint.org)-- [isort](https://pycqa.github.io/isort/)- [mypy](http://mypy-lang.org/)- [Prettier](https://prettier.io/)- [Puppet](https://puppet.com/) (puppet provides its own mechanism forvalidating manifests)-- [ruff](https://github.com/astral-sh/ruff)+- [Ruff](https://docs.astral.sh/ruff/)- [stylelint](https://github.com/stylelint/stylelint)Zulip also uses some home-grown code to perform tasks like validating@@ -109,8 +107,8 @@ describes our test system in detail.Most of our lint checks get performed by `./tools/lint`. These include thefollowing checks:-- Check Python code with ruff.-- Check Python formatting with Black and isort.+- Check Python code with Ruff.+- Check Python formatting with Ruff.- Check JavaScript and TypeScript code with ESLint.- Check CSS, JavaScript, TypeScript, and YAML formatting with Prettier.- Check Python code for custom Zulip rules.@@ -131,7 +129,7 @@ The rest of this document pertains to the checks that occur in `./tools/lint`.Zulip has a script called `lint` that lives in our "tools" directory.It is the workhorse of our linting system, although in some cases it-dispatches the heavy lifting to other components such as ruff,+dispatches the heavy lifting to other components such as Ruff,eslint, and other home grown tools.You can find the source code [here](https://github.com/zulip/zulip/blob/main/tools/lint).@@ -176,13 +174,12 @@ sense (e.g., a link in a comment to an extremely long URL).#### Python code-Our Python code is formatted using Black (using the options in the-`[tool.black]` section of `pyproject.toml`) and isort (using the-options in `.isort.cfg`). The `lint` script enforces this by running-Black and isort in check mode, or in write mode with `--fix`.+Our Python code is formatted using+[Ruff](https://docs.astral.sh/ruff/) (using the options in the+`[tool.ruff]` section of `pyproject.toml`). The `lint` script enforces+this by running Ruff in check mode, or in write mode with `--fix`.-The bulk of our Python linting gets outsourced to the "ruff" tool,-which is configured in the `tool.ruff` section of `pyproject.toml`.+The bulk of our Python linting also gets outsourced to Ruff.Zulip also has custom regex-based rules that it applies to Python code.Look for `python_rules` in the source code for `lint`. Note that wediff --git a/tools/setup/emoji/generate_emoji_names b/tools/setup/emoji/generate_emoji_namesindex 2b0ea235dbe..631841f4b4a 100755--- a/tools/setup/emoji/generate_emoji_names+++ b/tools/setup/emoji/generate_emoji_names@@ -214,7 +214,7 @@ def main() -> None:f.write("}\n")print(- "\n\nDone! You should run the linter to format emoji_names.py with `./tools/lint --fix -m --only black`"+ "\n\nDone! You should run the linter to format emoji_names.py with `./tools/lint --fix -m --only ruff-format`")