srctree

Robin Linden parent 6e43f4d1 8b9a3985
meta/clang-tidy: Enable readability-isolate-declaration

inlinesplit
.clang-tidy added: 13, removed: 5, total 8
@@ -45,6 +45,7 @@ Checks: >
readability-duplicate-include,
readability-identifier-naming,
readability-inconsistent-declaration-parameter-name,
readability-isolate-declaration,
readability-make-member-function-const,
readability-misleading-indentation,
readability-non-const-parameter,
 
css/parser.cpp added: 13, removed: 5, total 8
@@ -108,7 +108,8 @@ std::optional<int> to_int(std::string_view str) {
class Tokenizer {
public:
Tokenizer(std::string_view str, char delimiter) {
std::size_t pos = 0, loc = 0;
std::size_t pos = 0;
std::size_t loc = 0;
while ((loc = str.find(delimiter, pos)) != std::string_view::npos) {
if (auto substr = str.substr(pos, loc - pos); !substr.empty()) {
tokens_.push_back(substr);
@@ -576,7 +577,10 @@ void Parser::expand_background(Declarations &declarations, std::string_view valu
 
// https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius
void Parser::expand_border_radius_values(Declarations &declarations, std::string_view value) {
std::string top_left, top_right, bottom_right, bottom_left;
std::string top_left;
std::string top_right;
std::string bottom_right;
std::string bottom_left;
auto [horizontal, vertical] = util::split_once(value, "/");
Tokenizer tokenizer(horizontal, ' ');
// NOLINTBEGIN(bugprone-unchecked-optional-access): False positives.
@@ -722,7 +726,10 @@ void Parser::expand_flex_flow(Declarations &declarations, std::string_view value
}
 
void Parser::expand_edge_values(Declarations &declarations, std::string_view property, std::string_view value) {
std::string_view top, bottom, left, right;
std::string_view top;
std::string bottom;
std::string left;
std::string right;
Tokenizer tokenizer(value, ' ');
// NOLINTBEGIN(bugprone-unchecked-optional-access): False positives.
switch (tokenizer.size()) {