Use clang-format-18 for source formatting (#256)

* Updating clang-format to v18

- Updates the pre-commit-config
- Formats source files according to the utility

Signed-off-by: David Galiffi <David.Galiffi@amd.com>

* Update format source workflow

Signed-off-by: David Galiffi <David.Galiffi@amd.com>

* Update CONTRIBUTING

* Update comment in .clang-format

* Update CONTRIBUTING.md

* Update helper script

---------

Signed-off-by: David Galiffi <David.Galiffi@amd.com>

[ROCm/rocprofiler-systems commit: 1e13b590e7]
This commit is contained in:
David Galiffi
2025-06-22 08:48:08 -04:00
committed by GitHub
vanhempi 6a8cef771e
commit 0403aaa97f
76 muutettua tiedostoa jossa 258 lisäystä ja 255 poistoa
@@ -34,16 +34,16 @@ namespace
{
template <typename ContainerT, typename... Args>
inline auto
emplace_impl(ContainerT& _c, int, Args&&... _args)
-> decltype(_c.emplace_back(std::forward<Args>(_args)...))
emplace_impl(ContainerT& _c, int,
Args&&... _args) -> decltype(_c.emplace_back(std::forward<Args>(_args)...))
{
return _c.emplace_back(std::forward<Args>(_args)...);
}
template <typename ContainerT, typename... Args>
inline auto
emplace_impl(ContainerT& _c, long, Args&&... _args)
-> decltype(_c.emplace(std::forward<Args>(_args)...))
emplace_impl(ContainerT& _c, long,
Args&&... _args) -> decltype(_c.emplace(std::forward<Args>(_args)...))
{
return _c.emplace(std::forward<Args>(_args)...);
}
@@ -135,11 +135,11 @@ struct ROCPROFSYS_INTERNAL_API path_type
};
inline path_type(const std::string&);
~path_type() = default;
path_type(const path_type&) = default;
path_type(path_type&&) = default;
~path_type() = default;
path_type(const path_type&) = default;
path_type(path_type&&) = default;
path_type& operator=(const path_type&) = default;
path_type& operator=(path_type&&) = default;
path_type& operator=(path_type&&) = default;
bool exists() const { return m_type < unknown; }
explicit operator bool() const { return exists(); }
@@ -76,11 +76,11 @@ static_buffer_size()
template <typename Tp, typename ContextT = anonymous>
struct static_object
{
static_object() = delete;
~static_object() = delete;
static_object(const static_object&) = delete;
static_object(static_object&&) noexcept = delete;
static_object& operator=(const static_object&) = delete;
static_object() = delete;
~static_object() = delete;
static_object(const static_object&) = delete;
static_object(static_object&&) noexcept = delete;
static_object& operator=(const static_object&) = delete;
static_object& operator=(static_object&&) noexcept = delete;
template <typename... Args>
@@ -67,7 +67,7 @@ public:
: m_data{ std::move(data) }
{}
synchronized(synchronized&& data) noexcept = default;
synchronized(synchronized&& data) noexcept = default;
synchronized& operator=(synchronized&& data) noexcept = default;
// Do not allow this data structure to be copied, std::move only.