Open Eric-Arellano opened 1 year ago
Fixing consider-using-f-string (C0209) is worth trying ?
Yes, @lambda-knight consider-using-f-string looks useful to me. Note though that we are transitioning to Ruff instead of Pylint. So it may be worth double checking that Ruff has a similar lint.
Even if Ruff doesn't have it, I still think it's valuable to fix all our historical instances regardless of if we introduce future "regressions" or not. Let's say we have 200 issues now, and we introduce 50 in the next 60 months. Better to have 200/250 fixed than 0/250.
OK, @Eric-Arellano , Enabling consider-using-f-string, 192 files and 520 warnings are reported. I am fixing code of this warning and will issue PR.
@lambda-knight hi, can i help out with consider-using-f-string
?
Our previous Pylint version was 2.8, and I recently upgraded it to 2.16 in https://github.com/Qiskit/qiskit-terra/commit/041877bfc436cb7d8ddc799ab663ad1e62c08ff7. To facilitate landing it, I disabled a bunch of checks. But most of them would be good to activate.
Working on this PR means:
https://github.com/Qiskit/qiskit-terra/blob/4e3b283157b43687db4260cee6decf17fbb37608/.pylintrc#L77-L109
.pylintrc
tox -e lint
and fix all the issues untiltox -e lint
succeeds.To make it easier for code reviewers, it's a good idea to activate 1 or 2 checks at a time.