Open junkmd opened 1 week ago
I looked for the use location by git grep -n '%[sdxXorfFeEgGc]'
I will split modification into several PRs by file or dir.
@newwingbird
Thank you for your investigation.
Please note that the grep results mentioned above include items like logger.debug(...)
and _debug(...)
, which fall outside the scope of this issue.
Happy contributing!
@junkmd Thank you for your support.
I investigated by git grep -n '%[sdxXorfFeEgGc]' | grep -v 'logger\.debug' | grep -v '_debug'
I found the reduction of the applicable code . I will try this .
Hi @newwingbird,
Thanks for your quick response.
I noticed that _debug
, _warning
, logger.info
, and .CPP
files are included.
@junkmd
Okay, In addition, _error
too?
This issue's scope is only inside print
and string literal ?
@newwingbird
Okay, In addition,
_error
too?
I might have missed it, but if _error
exists, it would similarly fall outside the scope of this issue.
This issue's scope is only inside
That's right.
We could replace
%
string formatting with f-strings wherever applicable, as was done in #654.For details on f-string syntax, refer to the Python official documentation.
Most of the changes should follow these patterns:
"...%s..." % foo
withf"...{foo}..."
"...%r..." % foo
withf"...{foo!r}..."
"...%x..." % foo
withf"...{foo:x}..."
"...%d..." % foo
withf"...{foo:d}..."
There’s NO need to modify placeholders in logger method calls, as shown below. https://github.com/enthought/comtypes/blob/083c19e9fdc0f366df48ad448e897246f346ede0/comtypes/__init__.py#L137-L141
We welcome keeping changes as small as possible per pull request, as it makes it easier for reviewers to check the changes.
If your PR addresses multiple rules or files, reviewers might consider it a large change and suggest splitting it into multiple PRs.