Skip to content

chore(docs): add blacken-docs with 80 char line length for code blocks#4622

Open
Br1an67 wants to merge 2 commits intolitestar-org:mainfrom
Br1an67:fix/issue-3211-blacken-docs-line-length
Open

chore(docs): add blacken-docs with 80 char line length for code blocks#4622
Br1an67 wants to merge 2 commits intolitestar-org:mainfrom
Br1an67:fix/issue-3211-blacken-docs-line-length

Conversation

@Br1an67
Copy link
Copy Markdown
Contributor

@Br1an67 Br1an67 commented Mar 8, 2026

Fixes #3211

Description

Add blacken-docs to the pre-commit configuration with a line length of 80 characters to prevent documentation code blocks from becoming too wide and requiring horizontal scrolling.

This change adds the adamchainz/blacken-docs pre-commit hook configured with --line-length=80 to format Python code blocks in RST and Markdown documentation files.

Closes

Fixes #3211


📚 Documentation preview 📚: https://litestar-org.github.io/litestar-docs-preview/4622

- Fix multi-line caption in docs/usage/routing/handlers.rst
- Fix inconsistent indentation in docs/migration/flask.rst
- Apply blacken-docs formatting to all code blocks (80 char line length)
@github-actions github-actions bot added area/docs This PR involves changes to the documentation size: medium and removed size: small labels Mar 9, 2026
@Br1an67 Br1an67 force-pushed the fix/issue-3211-blacken-docs-line-length branch from ade3f96 to cd80850 Compare March 18, 2026 00:47
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.87%. Comparing base (c31aa51) to head (cd80850).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4622   +/-   ##
=======================================
  Coverage   97.87%   97.87%           
=======================================
  Files         292      292           
  Lines       15063    15077   +14     
  Branches     1703     1703           
=======================================
+ Hits        14743    14757   +14     
  Misses        184      184           
  Partials      136      136           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

This looks like a duplicate of #4112

I think that we can accept the doc changes, but I am not sure about the pre-commit hook :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/docs This PR involves changes to the documentation pr/external size: medium Triage Required 🏥 This requires triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs: Code block line length

2 participants