srctree

Robin Linden parent eddd3e1d d4468e7e
ci: Update to clang-format 17

inlinesplit
.github/workflows/ci.yaml added: 18, removed: 19, total 0
@@ -215,10 +215,10 @@ jobs:
- name: Set up the llvm repository
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main"
- run: sudo apt-get update && sudo apt-get install --no-install-recommends clang-format-15
sudo apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main"
- run: sudo apt-get update && sudo apt-get install --no-install-recommends clang-format-17
- name: Format
run: find . -name "*.h" -o -name "*.cpp" | xargs clang-format-15 -style=file -i
run: find . -name "*.h" -o -name "*.cpp" | xargs clang-format-17 -style=file -i
- name: Check
run: git diff --exit-code
 
 
browser/gui/app.cpp added: 18, removed: 19, total 0
@@ -193,10 +193,10 @@ App::App(std::string browser_title, std::string start_page_hint, bool load_start
: engine_{protocol::HandlerFactory::create(
"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0"),
create_font_system()},
browser_title_{std::move(browser_title)}, window_{sf::VideoMode(kDefaultResolutionX, kDefaultResolutionY),
browser_title_},
url_buf_{std::move(start_page_hint)}, canvas_{std::make_unique<gfx::SfmlCanvas>(
window_, static_cast<type::SfmlType &>(engine_.font_system()))} {
browser_title_{std::move(browser_title)},
window_{sf::VideoMode(kDefaultResolutionX, kDefaultResolutionY), browser_title_},
url_buf_{std::move(start_page_hint)},
canvas_{std::make_unique<gfx::SfmlCanvas>(window_, static_cast<type::SfmlType &>(engine_.font_system()))} {
window_.setMouseCursor(cursor_);
window_.setIcon(16, 16, kBrowserIcon.data());
if (!ImGui::SFML::Init(window_)) {
 
etest/etest2.h added: 18, removed: 19, total 0
@@ -22,10 +22,9 @@ namespace etest {
// source locations are optional.
 
template<typename T>
concept Printable = // Hack comment to get clang-format 15 and 16 to agree on the indentation.
requires(std::ostream &os, T t) {
{ os << t } -> std::same_as<std::ostream &>;
};
concept Printable = requires(std::ostream &os, T t) {
{ os << t } -> std::same_as<std::ostream &>;
};
 
struct RunOptions {
bool run_disabled_tests{false};
 
url/url.cpp added: 18, removed: 19, total 0
@@ -38,7 +38,7 @@ namespace url {
 
namespace {
// NOLINTNEXTLINE(cert-err58-cpp)
const std::map<std::string, std::uint16_t> special_schemes = {{"ftp", std::uint16_t{21}},
std::map<std::string, std::uint16_t> const special_schemes = {{"ftp", std::uint16_t{21}},
{"file", std::uint16_t{0}},
{"http", std::uint16_t{80}},
{"https", std::uint16_t{443}},
@@ -46,7 +46,7 @@ const std::map<std::string, std::uint16_t> special_schemes = {{"ftp", std::uint1
{"wss", std::uint16_t{443}}};
 
// NOLINTNEXTLINE(cert-err58-cpp)
const std::map<UrlParser::ValidationError, std::string> validation_error_str = {
std::map<UrlParser::ValidationError, std::string> const validation_error_str = {
{UrlParser::ValidationError::DomainToAscii, "Unicode ToASCII records an error or returns the empty string"},
{UrlParser::ValidationError::DomainToUnicode, "Unicode ToUnicode records an error"},
{UrlParser::ValidationError::DomainInvalidCodePoint, "The input's host contains a forbidden domain code point"},
 
url/url_test.cpp added: 18, removed: 19, total 0
@@ -18,7 +18,7 @@
#include <variant>
 
int main() {
const url::Url base{"https",
url::Url const base{"https",
"",
"",
url::Host{url::HostType::DnsDomain, "example.com"},