Skip to content

Conversation

cdce8p
Copy link
Member

@cdce8p cdce8p commented Sep 6, 2025

Description

Followup to #10528 (comment)

@cdce8p cdce8p added False Negative 🦋 No message is emitted but something is wrong with the code Match case labels Sep 6, 2025
Copy link

codecov bot commented Sep 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.88%. Comparing base (300cb79) to head (dc80e65).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #10542   +/-   ##
=======================================
  Coverage   95.88%   95.88%           
=======================================
  Files         177      177           
  Lines       19346    19349    +3     
=======================================
+ Hits        18549    18552    +3     
  Misses        797      797           
Files with missing lines Coverage Δ
pylint/checkers/design_analysis.py 98.95% <100.00%> (+0.01%) ⬆️
pylint/checkers/format.py 97.00% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This comment has been minimized.

Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

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

LGTM but there's definitely a discussion issue where we both discussed this that we need to close when merging :) (I'm on mobile i'll bé able to find it later)

@Pierre-Sassoulas Pierre-Sassoulas added this to the 4.0.0 milestone Sep 7, 2025
@Pierre-Sassoulas
Copy link
Member

I was thinking of this : #9667

@cdce8p cdce8p force-pushed the fix-too-many-branches-match branch from 00b41f4 to ffe05b7 Compare September 7, 2025 08:40

This comment has been minimized.

@cdce8p cdce8p force-pushed the fix-too-many-branches-match branch from 3954fd6 to dc80e65 Compare September 7, 2025 09:25
Copy link
Contributor

github-actions bot commented Sep 7, 2025

🤖 Effect of this PR on checked open source code: 🤖

Effect on home-assistant:
The following messages are now emitted:

  1. too-many-branches:
    Too many branches (16/12)
    https://github.com/home-assistant/core/blob/75f69cd5b6fef7da286101bd283f26b976768c85/homeassistant/components/recorder/statistics.py#L1019
  2. too-many-branches:
    Too many branches (13/12)
    https://github.com/home-assistant/core/blob/75f69cd5b6fef7da286101bd283f26b976768c85/homeassistant/components/recorder/statistics.py#L1289
  3. too-many-branches:
    Too many branches (40/12)
    https://github.com/home-assistant/core/blob/75f69cd5b6fef7da286101bd283f26b976768c85/homeassistant/components/sensor/recorder.py#L455
  4. too-many-branches:
    Too many branches (27/12)
    https://github.com/home-assistant/core/blob/75f69cd5b6fef7da286101bd283f26b976768c85/homeassistant/components/matter/climate.py#L258
  5. too-many-branches:
    Too many branches (30/12)
    https://github.com/home-assistant/core/blob/75f69cd5b6fef7da286101bd283f26b976768c85/homeassistant/components/home_connect/coordinator.py#L181
  6. too-many-branches:
    Too many branches (23/12)
    https://github.com/home-assistant/core/blob/75f69cd5b6fef7da286101bd283f26b976768c85/homeassistant/components/onkyo/media_player.py#L341
  7. too-many-branches:
    Too many branches (13/12)
    https://github.com/home-assistant/core/blob/75f69cd5b6fef7da286101bd283f26b976768c85/homeassistant/components/go2rtc/__init__.py#L306

The following messages are no longer emitted:

  1. too-many-branches:
    Too many branches (14/12)
    https://github.com/home-assistant/core/blob/75f69cd5b6fef7da286101bd283f26b976768c85/homeassistant/components/recorder/statistics.py#L1019
  2. too-many-branches:
    Too many branches (38/12)
    https://github.com/home-assistant/core/blob/75f69cd5b6fef7da286101bd283f26b976768c85/homeassistant/components/sensor/recorder.py#L455
  3. too-many-branches:
    Too many branches (15/12)
    https://github.com/home-assistant/core/blob/75f69cd5b6fef7da286101bd283f26b976768c85/homeassistant/components/matter/climate.py#L258
  4. too-many-branches:
    Too many branches (24/12)
    https://github.com/home-assistant/core/blob/75f69cd5b6fef7da286101bd283f26b976768c85/homeassistant/components/home_connect/coordinator.py#L181

Effect on pandas:
The following messages are now emitted:

  1. too-many-branches:
    Too many branches (14/12)
    https://github.com/pandas-dev/pandas/blob/7f670c17cd815a14167734abe5f3ad6e2b15d94d/pandas/core/computation/parsing.py#L145

Effect on sentry:
The following messages are now emitted:

  1. too-many-branches:
    Too many branches (21/12)
    https://github.com/getsentry/sentry/blob/a3c964707585de9d7aa8136c099340ec506a68ea/src/sentry/uptime/consumers/results_consumer.py#L289
  2. too-many-branches:
    Too many branches (14/12)
    https://github.com/getsentry/sentry/blob/a3c964707585de9d7aa8136c099340ec506a68ea/src/sentry/rules/conditions/event_frequency.py#L790
  3. too-many-branches:
    Too many branches (32/12)
    https://github.com/getsentry/sentry/blob/a3c964707585de9d7aa8136c099340ec506a68ea/src/sentry/replays/usecases/summarize.py#L305
  4. too-many-branches:
    Too many branches (35/12)
    https://github.com/getsentry/sentry/blob/a3c964707585de9d7aa8136c099340ec506a68ea/src/sentry/replays/usecases/ingest/event_parser.py#L336
  5. too-many-branches:
    Too many branches (13/12)
    https://github.com/getsentry/sentry/blob/a3c964707585de9d7aa8136c099340ec506a68ea/src/sentry/replays/lib/eap/snuba_transpiler.py#L722
  6. too-many-branches:
    Too many branches (21/12)
    https://github.com/getsentry/sentry/blob/a3c964707585de9d7aa8136c099340ec506a68ea/src/sentry/workflow_engine/handlers/condition/event_frequency_query_handlers.py#L196
  7. too-many-branches:
    Too many branches (13/12)
    https://github.com/getsentry/sentry/blob/a3c964707585de9d7aa8136c099340ec506a68ea/src/sentry/workflow_engine/endpoints/organization_detector_index.py#L152

The following messages are no longer emitted:

  1. too-many-branches:
    Too many branches (18/12)
    https://github.com/getsentry/sentry/blob/a3c964707585de9d7aa8136c099340ec506a68ea/src/sentry/uptime/consumers/results_consumer.py#L289
  2. too-many-branches:
    Too many branches (19/12)
    https://github.com/getsentry/sentry/blob/a3c964707585de9d7aa8136c099340ec506a68ea/src/sentry/replays/usecases/ingest/event_parser.py#L336

This comment was generated for commit dc80e65

@cdce8p
Copy link
Member Author

cdce8p commented Sep 7, 2025

LGTM but there's definitely a discussion issue where we both discussed this that we need to close when merging :) (I'm on mobile i'll bé able to find it later)

I was thinking of this : #9667

Didn't realize this was this open. IMO match in Python is basically an enhanced if statement. So checks should treat it similarly. AFAICT that was also your opinion on the ruff issue, unless I got that wrong.

--
So I'd suggest we move forward with this one and look to finish #9667 afterwards.

@cdce8p cdce8p merged commit 90c09a3 into pylint-dev:main Sep 7, 2025
44 checks passed
@cdce8p cdce8p deleted the fix-too-many-branches-match branch September 7, 2025 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
False Negative 🦋 No message is emitted but something is wrong with the code Match case
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants