Skip to content

Conversation

@RR5555
Copy link
Contributor

@RR5555 RR5555 commented Jan 11, 2026

This PR adds tool.ruff.lint rule W505 (doc-line-too-long) with a corresponding tool.ruff.lint.pycodestyle.max-doc-length with default value 72 as per PEP8 recommendation.

This would enforce docstring max length consistency.

Note

If the PR gets green-lighted, I will add a commit to it that effectively applies the rule to all already existing docstrings.

…ding `tool.ruff.lint.pycodestyle.max-doc-length` with default value 72 as per PEP8 recommendation

Enforce docstring max length consistency by `ruff` rule
@codecov
Copy link

codecov bot commented Jan 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.26%. Comparing base (3ae340d) to head (11ca80b).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2452   +/-   ##
=======================================
  Coverage   97.26%   97.26%           
=======================================
  Files          55       55           
  Lines        6299     6299           
=======================================
  Hits         6127     6127           
  Misses        172      172           
Flag Coverage Δ
unittests 97.26% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@RR5555 RR5555 marked this pull request as draft January 11, 2026 06:50
@RR5555 RR5555 closed this Jan 11, 2026
@RR5555 RR5555 reopened this Jan 11, 2026
@RR5555 RR5555 marked this pull request as ready for review January 11, 2026 06:56
Copy link
Member

@sisp sisp left a comment

Choose a reason for hiding this comment

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

Thanks for adding this Ruff rule to help us maintain consistent docstrings! 🙇 Definitely a 👍 from me. Just one inline comment regarding the maximum line length.

convention = "google"

[tool.ruff.lint.pycodestyle]
max-doc-length = 72
Copy link
Member

Choose a reason for hiding this comment

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

Should we make this 88? Ruff (and Black) diverge from PEP 8 regarding code line length and use 88. https://docs.astral.sh/ruff/settings/#lint_pycodestyle_max-doc-length shows an example with 88. Perhaps we can decide based on how re-formatted docstrings look with PEP 8's 72 characters or 88. I just wonder whether 72 might result in some too narrow and long text blocks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I personally do not mind long comment lines as I just word-wrap, but I am all for consistency and automation.
Thus, I shall let you decide what the best max length should be.
Just let me know ;)

Copy link
Member

Choose a reason for hiding this comment

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

Okay, let's align max-doc-length with max-line-length, i.e. use 88 characters.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants