Skip to content

chore: replace flake8 and black with ruff - #1566

Merged
WilliamBergamin merged 4 commits into
mainfrom
adopt-ruff
Aug 27, 2026
Merged

chore: replace flake8 and black with ruff#1566
WilliamBergamin merged 4 commits into
mainfrom
adopt-ruff

Conversation

@WilliamBergamin

@WilliamBergamin WilliamBergamin commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

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 .flake8 ignores, and ruff 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 files
  • Relevant sync/async dispatch + ASGI adapter tests pass; all reformatted files verified to compile on Python 3.7.

Category

  • slack_bolt.App and/or its core components
  • slack_bolt.async_app.AsyncApp and/or its core components
  • Adapters in slack_bolt.adapter
  • Document pages under /docs
  • Others

Requirements

  • I've read and understood the Contributing Guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've run ./scripts/install_all_and_run_tests.sh after making the changes.

WilliamBergamin and others added 2 commits August 27, 2026 14:02
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

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.54%. Comparing base (a70d247) to head (6fae899).
✅ All tests successful. No failed tests found.

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.
📢 Have feedback on the report? Share it here.

@WilliamBergamin WilliamBergamin changed the title Replace flake8 and black with ruff chore: replace flake8 and black with ruff Aug 27, 2026
@WilliamBergamin WilliamBergamin self-assigned this Aug 27, 2026
@WilliamBergamin WilliamBergamin added this to the next milestone Aug 27, 2026
@WilliamBergamin
WilliamBergamin marked this pull request as ready for review August 27, 2026 18:44
@WilliamBergamin
WilliamBergamin requested a review from a team as a code owner August 27, 2026 18:44

@zimeg zimeg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WilliamBergamin 🐶 Ruff! Or... "LGTM" in human speak!

@WilliamBergamin
WilliamBergamin merged commit 5814077 into main Aug 27, 2026
16 checks passed
@WilliamBergamin
WilliamBergamin deleted the adopt-ruff branch August 27, 2026 18:50
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants