Describe the bug
Eight files under pcapkit/{const,vendor}/{ftp,http}/ still carry # pylint: disable=consider-using-f-string. #817 earns it for the command.py/method.py pair; these are the remainder.
Measured on 55e1b756e:
const/ftp/return_code.py const/http/error_code.py const/http/frame.py
const/http/setting.py const/http/status_code.py
vendor/ftp/return_code.py vendor/http/frame.py vendor/http/status_code.py (x2)
Expected behavior
f-strings throughout, and the disable dropped from every one — at which point the claim "nothing under pcapkit/{const,vendor}/{ftp,http}/ needs it" is finally true. #804's body asserted that prematurely; #817's author caught it, and this issue is the actual remainder.
Additional context
Three of the const/ files inherit their % from a shared template, not from their own generator: const/http/{error_code,frame,setting}.py come from pcapkit/vendor/default.py:55. So converting those three means editing the shared base, which emits far more than these eight files — check the blast radius across every generated const/ module before touching it, and expect that change to want its own PR.
Two traps, both hit on this family today:
Use pylint with the real Makefile flag set plus useless-suppression to confirm each drop is earned — --disable=all --enable=useless-suppression manufactures false hits.
Related: #804, #817, #798, #783.
Describe the bug
Eight files under
pcapkit/{const,vendor}/{ftp,http}/still carry# pylint: disable=consider-using-f-string. #817 earns it for thecommand.py/method.pypair; these are the remainder.Measured on
55e1b756e:Expected behavior
f-strings throughout, and the disable dropped from every one — at which point the claim "nothing under
pcapkit/{const,vendor}/{ftp,http}/needs it" is finally true. #804's body asserted that prematurely; #817's author caught it, and this issue is the actual remainder.Additional context
Three of the
const/files inherit their%from a shared template, not from their own generator:const/http/{error_code,frame,setting}.pycome frompcapkit/vendor/default.py:55. So converting those three means editing the shared base, which emits far more than these eight files — check the blast radius across every generatedconst/module before touching it, and expect that change to want its own PR.Two traps, both hit on this family today:
%structurally, not textually. My own vendor: three %-formatted __repr__ methods keep the f-string disable alive in ftp.command and http.method #804 table saidvendor/ftp/command.pyhad 3%-format sites andvendor/http/method.py2; an AST walk overBinOp(Constant(str) % x)gives 1 each, because inside aLINE = lambda …: f'''template the__repr__lines are string content. And a%-grep must allow both quote styles —'[^']*%[sdr]reported 0 on files whose every site was double-quoted.tests/for assertions that pin the disable as RETAINED.test_const_enum_builtin_parity.py:658did exactly that for refactor(const): f-string the last three %-formatted __repr__ methods (#804) #817's pair (assertIn('consider-using-f-string', source)plusassertIn('%', source)), so it had to be flipped. Expect the same shape here, and flip rather than delete.Use
pylintwith the real Makefile flag set plususeless-suppressionto confirm each drop is earned —--disable=all --enable=useless-suppressionmanufactures false hits.Related: #804, #817, #798, #783.