Skip to content

Enable flake8-logging-format (G) linting rules via Ruff#5930

Merged
suhaibmujahid merged 13 commits intomozilla:masterfrom
uvindusl:fix-g004-logging-fstring
May 5, 2026
Merged

Enable flake8-logging-format (G) linting rules via Ruff#5930
suhaibmujahid merged 13 commits intomozilla:masterfrom
uvindusl:fix-g004-logging-fstring

Conversation

@uvindusl
Copy link
Copy Markdown
Contributor

Overview

This PR addresses issue #5792 by enabling and fixing violations of the Ruff lint rule G004 (logging-f-string). f-strings in logger calls have been replaced with lazy %-style formatting to improve performance and adhere to Mozilla's logging standards.

Changes

Refactored Logging: Converted f-strings to lazy interpolation in the following files:

    bugbug/code_search/parser.py
    bugbug/model.py
    bugbug/models/testselect.py
    bugbug/repository.py
    bugbug/tools/build_repair/agent.py

Copy link
Copy Markdown
Member

@suhaibmujahid suhaibmujahid left a comment

Choose a reason for hiding this comment

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

Thank you! Please fix the failing linting errors. Installing pre-commit will allow you to test that locally.

BTW. The PR enables all flake8-logging-format (G) rules, but this is fine. I will update the PR title to reflect that.

Comment thread pyproject.toml Outdated
@suhaibmujahid suhaibmujahid changed the title fix: Enable Ruff rule G004 (logging-f-string) in multiple modules Enable flake8-logging-format (G) linting rules via Ruff Apr 11, 2026
@uvindusl uvindusl requested a review from suhaibmujahid April 13, 2026 05:05
Copy link
Copy Markdown
Member

@suhaibmujahid suhaibmujahid left a comment

Choose a reason for hiding this comment

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

@uvindusl the lint task is still failing. Could you please fix it so we can merge this PR?

Also, consider running pre-commit locally; it'll help you catch errors faster instead of waiting on CI.

Comment thread .pre-commit-config.yaml Outdated
@uvindusl uvindusl requested a review from suhaibmujahid May 5, 2026 10:40
Copy link
Copy Markdown
Member

@suhaibmujahid suhaibmujahid left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!

@suhaibmujahid suhaibmujahid merged commit 80e557f into mozilla:master May 5, 2026
6 checks passed
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