Enable misc-non-private-member-variables-in-classes and adjust style to match (#4702)

Pursuant to discussion regarding #4699, turn on
`misc-non-private-member-variables-in-classes` using the
`IgnoreClassesWithAllMemberVariablesBeingPublic` flag (the check treats
structs as classes, so we need this for structs with all-public
members). Updates the style guide notes to match, which should be pretty
minor due to the scoping of test fixtures.

Also fixes some underscore uses in test files on the way. Basically this
is keeping the style for [class data member
naming](https://google.github.io/styleguide/cppguide.html#Variable_Names)
even while making them public.
This commit is contained in:
Jon Ross-Perkins
2024-12-19 00:31:41 +00:00
committed by GitHub
parent f67a4a5bcb
commit cb4686bf21
11 changed files with 56 additions and 43 deletions
+5
View File
@@ -184,6 +184,11 @@ these.
- Tests are an exception and should typically be wrapped in an anonymous
namespace under the namespace of the code under test, to keep everything
internal.
- For
[Access Control](https://google.github.io/styleguide/cppguide.html#Access_Control),
specifically for test fixtures in `.cpp` files, we use `public` instead of
`protected`. This is motivated by the
`misc-non-private-member-variables-in-classes` tidy check.
### Copyable and movable types