chore: replace flake8 and black with ruff - #1566
Merged
Merged
Conversation
One-time mechanical reformat from adopting `ruff format` in place of black. Only the documented ruff-vs-black differences (implicit string-concat joining, f-string inner-quote normalization, blank-line-at-block-start removal). No behavior changes; verified to still compile on Python 3.7. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Swap the two separate dev tools -- flake8 (lint) and black (format) -- for a single ruff binary that does both. - pyproject.toml: add [tool.ruff] (line-length = 125) and [tool.ruff.lint] with select = ["E", "W", "F"] plus the ignore set carried over from .flake8 (F841, F821, E402); drop [tool.black]. - requirements/dev_tools.txt: replace flake8 and black with ruff. - delete .flake8 (settings now live in pyproject.toml). - scripts/format.sh: ruff check --fix + ruff format. - scripts/lint.sh: ruff check. - rename the file-level `# flake8: noqa` directives to `# ruff: noqa`. - freeze three middleware/handler dispatch calls with `# fmt: skip` so ruff format cannot detach their `# type: ignore` comments (which would break mypy under warn_unused_ignores). - record the reformat commit in .git-blame-ignore-revs. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1566 +/- ##
=======================================
Coverage 91.54% 91.54%
=======================================
Files 228 228
Lines 7285 7285
=======================================
Hits 6669 6669
Misses 616 616 ☔ View full report in Codecov by Harness. |
WilliamBergamin
marked this pull request as ready for review
August 27, 2026 18:44
zimeg
approved these changes
Aug 27, 2026
zimeg
left a comment
Member
There was a problem hiding this comment.
@WilliamBergamin 🐶 Ruff! Or... "LGTM" in human speak!
8 tasks
WilliamBergamin
added a commit
that referenced
this pull request
Aug 27, 2026
The listed 07e8ac9 was the pre-squash branch commit from PR #1566; that SHA is unreachable from main, so git blame silently ignored the entry. Point it at the squash-merge commit 5814077, which is the reachable commit that actually carried the ruff-format sweep onto main. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
lukegalbraithrussell
added a commit
that referenced
this pull request
Aug 28, 2026
Rebase the Markdown API reference migration onto main now that Ruff (#1566) and docstring formatting/linting (#1567) have landed. - Defer all docstring/formatting ownership to main: dropped this branch's hand-fenced docstring edits across slack_bolt/** so main's ruff-formatted docstrings are the single source. The generator's _reflow_indented_code now fences main's indented examples at generation time. - Regenerated docs/english/reference/** from main's docstrings (234 pages); ruff docstring-code-format now shapes the fenced examples. - Fenced the two column-0 examples in the Falcon adapter docstrings (resource.py, async_resource.py) that _reflow_indented_code cannot reach; these are the only remaining source changes in this PR. - Replaced .flake8 with main's pyproject ruff config; scripts/format.sh and scripts/lint.sh now run ruff. Net PR surface shrinks to the doc tooling (generator, requirements, sidebar, redirects, CI drift job), the generated tree, and 2 fence fixes. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the two separate dev tools -- flake8 (lint) and black (format) -- with a single ruff binary that does both.
Chosen for the simplest config that changes the source the least: a narrow lint
select = ["E", "W", "F"](mirroring flake8's pycodestyle + pyflakes) carrying over the old.flake8ignores, andruff format(a near-drop-in for black).This will allow us to improve our docstring formatting and lintting to enable markdown docs generation
Testing
./scripts/lint.sh --no-install->All checks passed!./scripts/format.sh --no-install-> no changes (475 files already formatted)./scripts/run_mypy.sh --no-install->Success: no issues found in 234 source filesCategory
slack_bolt.Appand/or its core componentsslack_bolt.async_app.AsyncAppand/or its core componentsslack_bolt.adapter/docsRequirements
./scripts/install_all_and_run_tests.shafter making the changes.