Skip to content

fix(whitespace/indent_namespace): Three false positives#376

Merged
aaronliu0130 merged 4 commits intodevelopfrom
falsepositive
Nov 28, 2025
Merged

fix(whitespace/indent_namespace): Three false positives#376
aaronliu0130 merged 4 commits intodevelopfrom
falsepositive

Conversation

@aaronliu0130
Copy link
Member

Should fix #372

fix(whitespace/indent_namespace): Specifier & multiline false positives for constructors

  • Fix false positive for when a function specifier (e.g. inline, protected) is provided
  • Fix false positive for when constructor ends on the same line a MemInitList does, but on a different line from said list's start
  • Fix ownership assignment of open parentheses
  • Use search instead of match for some cases
  • Fix typo & misc refactoring

fix(whitespace/indent_namespace): Curly braces in MemInitList

  • Fixes : a({0}), b{"c", d} etc. F/Ps
  • Consumes and updates state of MemInitList so we get to the curly braces before _ConsumeEnd() does
  • Splits ending token searches/checks into _ConsumeEnd()
  • Requires starting index to initialize _WrapInfos
  • Renames _WrappedInfo to _WrapInfo since Wrapped is not a noun

…es for constructors

Fix false positive for when a function specifier (e.g. `inline`, `protected`) is provided
Fix false positive for when constructor ends on the same line a MemInitList does, but on a different line from said list's start
Fix ownership assignment of open parentheses
Use search instead of match for some cases
Fix typo & misc refactoring
Fixes `: a({0}), b{"c", d}` etc. F/Ps
Consumes and updates state of MemInitList so we get to the curly braces before _ConsumeEnd() does
Splits ending token searches/checks into `_ConsumeEnd()`
Requires starting index to initialize `_WrapInfo`s
Renames _WrappedInfo to _WrapInfo since Wrapped is not a noun
…ned consumption

Fix the direction in which we find braces
Fix bug where consumption doesn't happen due to return None without returning the consumed line
Refactored consumption functions to have the loop themselves
Change tests to account for that
@aaronliu0130 aaronliu0130 merged commit 45102d1 into develop Nov 28, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

False positive for whitespace/indent_namespace with member initializer lists

2 participants