Skip to content

chore: prune unnecessary code (automated weekly cleanup)#141

Open
Miyamura80 wants to merge 1 commit intomainfrom
fix/unused-code-12370737117778100367
Open

chore: prune unnecessary code (automated weekly cleanup)#141
Miyamura80 wants to merge 1 commit intomainfrom
fix/unused-code-12370737117778100367

Conversation

@Miyamura80
Copy link
Owner

Removed unused variables type_ and tb from src/utils/logging_config.py.

Evidence:
The variables type_ and tb were obtained by unpacking exception tuple from the log record in scrub_sensitive_data. They were not used anywhere else in the function.

I have thoroughly checked vulture output against UNNECESSARY_CODE_GUIDELINE.md constraints. All other variables reported as unused (like get_field_value, to_dict, setup_logging) were either part of protected patterns (Pydantic models) or explicitly used in tests or documentation.


PR created automatically by Jules for task 12370737117778100367 started by @Miyamura80

Co-authored-by: Miyamura80 <38335479+Miyamura80@users.noreply.github.com>
@google-labs-jules
Copy link
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 11, 2026

Greptile Summary

This PR removes the unused type_ and tb variables from the exception-tuple unpacking in scrub_sensitive_data inside src/utils/logging_config.py, replacing them with the conventional _ discard placeholder. The only meaningful value from the tuple — value (the exception instance) — continues to be used correctly for scrubbing.

  • The loguru record["exception"] tuple follows Python's sys.exc_info() contract: (type, value, traceback). Replacing the outer two with _ is idiomatic and safe.
  • Using _ twice in a single unpacking (_, value, _ = exception) is valid Python; the second binding simply shadows the first, both are discarded.
  • No logic change — value handling, value.args scrubbing, and the surrounding guard conditions are all untouched.
  • The cleanup is minimal and low-risk.

Confidence Score: 5/5

  • This PR is safe to merge — it is a one-line cosmetic cleanup with no functional impact.
  • The only change is substituting two genuinely unused variable names with _. The variable that matters (value) is unchanged, and the surrounding scrubbing logic is unaffected. No new code paths, no changed behaviour.
  • No files require special attention.

Important Files Changed

Filename Overview
src/utils/logging_config.py Replaces the named-but-unused type_ and tb variables with _ when unpacking the loguru exception tuple, silencing unused-variable warnings with no functional change.

Last reviewed commit: 1bfe87d

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.

1 participant