Repository navigation
Conversation
named_query_regex, used to strip a leading '\ns <name>' from the text passed to the autocompleter, matched names with [A-z0-9\-]. The A-z range also covers the characters [ \ ] ^ _ and `, which CodeQL flags as py/overly-large-range. Spell the class out as [A-Za-z0-9_\-] instead, keeping the underscore deliberately since pgcli, from which this code is derived, now lists it explicitly in the same regex.
|
No actionable comments were generated in the recent review. WalkthroughThe saved-query name pattern now accepts uppercase and lowercase letters, digits, underscores, and hyphens. ChangesSaved-query name matching
Estimated code review effort: 1 (Trivial) | ~3 minutes Change: Bug fix Suggested reviewers: Merge Risk:
|
Fixes CodeQL alert 41 (
py/overly-large-range):named_query_regexinsqlcompletion.pyused[A-z0-9\-], andA-zalso matches[ \ ] ^ _ `.The class is now
[A-Za-z0-9_\-]. The underscore is kept on purpose, since pgcli (which this code comes from) now lists it explicitly in the same regex, so names likemy_querystill get stripped.Summary by CodeRabbit