clang-tidy: Enforce google-global-names-in-headers
I remove the alias altogether because it appears inconsistent with the
style guide: "Don't put an alias in your public API just to save typing
in the implementation; do so only if you intend it to be used by your
clients." (https://google.github.io/styleguide/cppguide.html#Aliases).
Bug: 45
Change-Id: Ie9878250ca34387241d70d4261e9269147d8dcb6
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/68084
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Commit-Queue: Ted Pudlik <tpudlik@google.com>
diff --git a/.clang-tidy b/.clang-tidy
index ca75a68..1a64978 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -23,6 +23,7 @@
google-build-explicit-make-pair,
google-build-namespaces,
google-default-arguments,
+ google-global-names-in-headers,
google-readability-function-size,
google-readability-namespace-comments,
google-runtime-operator,
diff --git a/pw_sync_stl/public/pw_sync_stl/counting_semaphore_inline.h b/pw_sync_stl/public/pw_sync_stl/counting_semaphore_inline.h
index 010a133..466b374 100644
--- a/pw_sync_stl/public/pw_sync_stl/counting_semaphore_inline.h
+++ b/pw_sync_stl/public/pw_sync_stl/counting_semaphore_inline.h
@@ -16,8 +16,6 @@
#include "pw_chrono/system_clock.h"
#include "pw_sync/counting_semaphore.h"
-using pw::chrono::SystemClock;
-
namespace pw::sync {
inline CountingSemaphore::CountingSemaphore()
@@ -26,9 +24,10 @@
inline CountingSemaphore::~CountingSemaphore() {}
inline bool CountingSemaphore::try_acquire_for(
- chrono::SystemClock::duration timeout) {
+ pw::chrono::SystemClock::duration timeout) {
// Due to spurious condition variable wakeups this cannot use wait_for().
- return try_acquire_until(chrono::SystemClock::TimePointAfterAtLeast(timeout));
+ return try_acquire_until(
+ pw::chrono::SystemClock::TimePointAfterAtLeast(timeout));
}
inline CountingSemaphore::native_handle_type