Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions osquery/events/tests/linux/inotify_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ namespace fs = boost::filesystem;
namespace osquery {
DECLARE_bool(enable_file_events);

namespace {
const int kMaxEventLatency = 3000;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🦩 🟠 File-scope constant kMaxEventLatency violates established kPascalCase-only scoping/anonymous-namespace convention

Wrapped const int kMaxEventLatency = 3000; in an anonymous namespace (namespace { ... } // namespace) directly where it was declared inside namespace osquery, giving it internal linkage per translation unit and satisfying OSQUERY-007 scoping convention while preserving its use in all subsequent TEST_F bodies unchanged.

🤖 Prompt for AI agents
In osquery/events/tests/linux/inotify_tests.cpp around line 32, review and complete this code-review fix: File-scope constant kMaxEventLatency violates established kPascalCase-only scoping/anonymous-namespace convention.
What the draft fix changed: Wrapped `const int kMaxEventLatency = 3000;` in an anonymous namespace (`namespace { ... } // namespace`) directly where it was declared inside `namespace osquery`, giving it internal linkage per translation unit and satisfying OSQUERY-007 scoping convention while preserving its use in all subsequent `TEST_F` bodies unchanged.
Verify the change is correct and complete; do not refactor unrelated code.

fix confidence: 🟢 95 high — react 👍/👎 to teach the reviewer

} // namespace

class INotifyTests : public testing::Test {
bool enable_file_events_backup{false};
Expand Down
Loading