🧹 cleanup warnings from clang-format

This commit is contained in:
Vladislav Nepogodin 2022-11-20 04:24:16 +04:00
parent cf7b519395
commit 22e77296d1
No known key found for this signature in database
GPG Key ID: B62C3D10C54D5DA9
2 changed files with 3 additions and 0 deletions

View File

@ -49,4 +49,5 @@ jobs:
with: with:
clang-format-version: '14' clang-format-version: '14'
check-path: 'src' check-path: 'src'
exclude-regex: 'src/subprocess.h'

View File

@ -37,6 +37,7 @@ bool Initcpio::write() const noexcept {
} }
std::string&& result = file_content | ranges::views::split('\n') std::string&& result = file_content | ranges::views::split('\n')
| ranges::views::transform([&](auto&& rng) { | ranges::views::transform([&](auto&& rng) {
/* clang-format off */
auto&& line = std::string_view(&*rng.begin(), static_cast<size_t>(ranges::distance(rng))); auto&& line = std::string_view(&*rng.begin(), static_cast<size_t>(ranges::distance(rng)));
if (line.starts_with("MODULES")) { if (line.starts_with("MODULES")) {
auto&& formatted_modules = modules | ranges::views::join(' ') auto&& formatted_modules = modules | ranges::views::join(' ')
@ -51,6 +52,7 @@ bool Initcpio::write() const noexcept {
| ranges::to<std::string>(); | ranges::to<std::string>();
return fmt::format("HOOKS=({})", std::move(formatted_hooks)); return fmt::format("HOOKS=({})", std::move(formatted_hooks));
} }
/* clang-format on */
return std::string{line.data(), line.size()}; return std::string{line.data(), line.size()};
}) })
| ranges::views::join('\n') | ranges::views::join('\n')