TD003: remove issue code length restriction#15175
TD003: remove issue code length restriction#15175MichaReiser merged 2 commits intoastral-sh:mainfrom
Conversation
|
3b0a1be to
0991625
Compare
There was a problem hiding this comment.
Nice, thank you.
Our current implementation matches the Regex of the upstream flake8-todos implementation. I tried to figure out the reason from the upstream blame but without success, because the blame doesn't allow me to go past the most recent revision for the regex line). I also checked the PR adding rule to see if there's any discussion around what issue formats to support, but I couldn't find any.
That said, I think it's fine to remove the length restriction. It helps to remove some false positives, like in your case, and I think it's unlikely to reduce true positives, considering that the format is unlikely to be used in a regular comment. I'd prefer to remove it entirely instead of just bumping it to 12.
We also need to update the rule's documentation because it mentions up to 6 which would now be outdated.
* main: [`ruff`] Avoid reporting when `ndigits` is possibly negative (`RUF057`) (#15234) Attribute panics to the mdtests that cause them (#15241) Show errors for attempted fixes only when passed `--verbose` (#15237) [`RUF`] Add rule to detect empty literal in deque call (`RUF025`) (#15104) TD003: remove issue code length restriction (#15175) Preserve multiline implicit concatenated strings in docstring positions (#15126) [`pyflakes`] Ignore errors in `@no_type_check` string annotations (`F722`, `F821`) (#15215) style(AIR302): rename removed_airflow_plugin_extension as check_airflow_plugin_extension (#15233) [`pylint`] Re-implement `unreachable` (`PLW0101`) (#10891) refactor(AIR303): move duplicate qualified_name.to_string() to Diagnostic argument (#15220) Misc. clean up to rounding rules (#15231) Avoid syntax error when removing int over multiple lines (#15230) Migrate renovate config (#15228) Remove `Type::tuple` in favor of `TupleType::from_elements` (#15218)
Summary
My company has issue codes longer than 6 characters, and I imagine we're not the only ones. The current maximum value of 6 characters seems arbitrary (please correct me if I'm missing something), so I chose the value of 12, since that would easily cover every issue code my company uses (and I sincerely doubt there are very many users using codes longer than this).
Test Plan
I added some additional snapshot checks which cover the new boundary conditions.