Skip to content

Bump Ruff to v0.15.18 and address new lint violations#826

Open
julianz- wants to merge 2 commits into
cherrypy:mainfrom
julianz-:bump-ruff-v0.15.18
Open

Bump Ruff to v0.15.18 and address new lint violations#826
julianz- wants to merge 2 commits into
cherrypy:mainfrom
julianz-:bump-ruff-v0.15.18

Conversation

@julianz-

Copy link
Copy Markdown
Member

Updates Ruff from v0.13.3 to v0.15.18
This requires the following changes:

  • Fix D421: reword property docstrings to noun phrases
  • Fix ISC004: parenthesize implicit string concatenation in collections; use single strings with # noqa: LN001 where readability is better
  • Drop now-redundant # noqa: D401 comments on property definitions
  • Suppress PLW0717, RUF067, S607 pending future fixes

What kind of change does this PR introduce?

  • 🐞 bug fix
  • 🐣 feature
  • 📋 docs update
  • 📋 tests/coverage improvement
  • 📋 refactoring
  • 💥 other

📋 What is the related issue number (starting with #)

Resolves #

What is the current behavior? (You can also link to an open issue here)

What is the new behavior (if this is a feature change)?

📋 Other information:

📋 Contribution checklist:

(If you're a first-timer, check out
[this guide on making great pull requests][making a lovely PR])

  • I wrote descriptive pull request text above
  • I think the code is well written
  • I wrote [good commit messages]
  • I have [squashed related commits together][related squash] after
    the changes have been approved
  • Unit tests for the changes exist
  • Integration tests for the changes exist (if applicable)
  • I used the same coding conventions as the rest of the project
  • The new code doesn't generate linter offenses
  • Documentation reflects the changes
  • The PR relates to only one subject with a clear title
    and description in grammatically correct, complete sentences

@psf-chronographer psf-chronographer Bot added the bot:chronographer:provided A mark meaning that a new change log entry is present within the patch. label Jun 20, 2026
@read-the-docs-community

read-the-docs-community Bot commented Jun 20, 2026

Copy link
Copy Markdown

Documentation build overview

📚 cheroot | 🛠️ Build #33277062 | 📁 Comparing a9282c0 against latest (18f4ba8)

  🔍 Preview build  

5 files changed · ± 5 modified

± Modified

@julianz- julianz- force-pushed the bump-ruff-v0.15.18 branch from 794639b to 2bfeca8 Compare June 20, 2026 21:26
@codecov

codecov Bot commented Jun 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.17%. Comparing base (18f4ba8) to head (a9282c0).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #826      +/-   ##
==========================================
- Coverage   78.19%   78.17%   -0.03%     
==========================================
  Files          41       41              
  Lines        4788     4788              
  Branches      547      547              
==========================================
- Hits         3744     3743       -1     
- Misses        905      906       +1     
  Partials      139      139              

@julianz- julianz- requested a review from webknjaz June 21, 2026 18:17

@webknjaz webknjaz 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.

Do you feel strongly about those noqas?

Comment thread .ruff.toml Outdated
"PLR6301", # no-self-use # FIXME / noqa

"PLW0717", # too-many-statements-in-try-clause # FIXME

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.

Suggested change

Comment thread .ruff.toml Outdated
"PLR6104", # non-augmented-assignment # FIXME
"PLR6301", # no-self-use # FIXME / noqa

"PLW0717", # too-many-statements-in-try-clause # FIXME

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.

Are there many of these? I mostly prefer narrowly scoped ignores when adding new rules.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

There are 8 violations across 6 files. I've moved PLW0717 to per-file ignores (production files + test files) rather than keeping it in the global suppress list — that way the rule stays active everywhere else. Happy to switch to individual # noqa: PLW0717 lines on each violation if you prefer?

Comment thread cheroot/test/_pytest_plugin.py Outdated
'<socket.socket fd=-1, family=AF_INET6, '
'type=SocketKind.SOCK_STREAM, proto=.:'
'pytest.PytestUnraisableExceptionWarning:_pytest.unraisableexception',
'ignore:Exception in thread CP Server Thread-:pytest.PytestUnhandledThreadExceptionWarning:_pytest.threadexception', # noqa: LN001

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.

I'd like to keep these multi-line instead of having ignores. Let's go for nested parentheses instead.

Three further new rules are suppressed pending fixes: too many statements
in a try clause (PLW0717), non-empty ``__init__`` modules (RUF067), and
starting a process with a partial executable path (S607)
-- by :user:`julianz-`.

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.

You probably want this

Suggested change
-- by :user:`julianz-`.
-- by :user:`julianz-`

@@ -0,0 +1,9 @@
Bumped Ruff to v0.15.18, which introduces new rules:

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.

IIRC, you have to add an empty line for the RST parser to see this as a list.

Suggested change
Bumped Ruff to v0.15.18, which introduces new rules:
Bumped Ruff to v0.15.18, which introduces new rules:

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Think fixed now hopefully.

- Fix D421: reword property docstrings to noun phrases
- Fix ISC004: parenthesize implicit string concatenation in collections;
  use single strings with # noqa: LN001 where readability is better
- Drop now-redundant # noqa: D401 comments on property definitions
- Suppress PLW0717, RUF067, S607 pending future fixes
@julianz- julianz- force-pushed the bump-ruff-v0.15.18 branch from 2bfeca8 to 323f3b9 Compare June 23, 2026 19:14
Suppresses too-many-statements-in-try-clause only in the files that
actually trigger it, rather than globally. Test files are also covered.
Global suppression masked the rule entirely; per-file ignores leave it
active elsewhere and make the FIXMEs more targeted.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided A mark meaning that a new change log entry is present within the patch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants