formatter: Format deftype correctly (#3391)

New configuration options to format column widths in deftype field
definitions. Also force each field/method/state to be inlined.
This commit is contained in:
Tyler Wilding
2024-02-27 20:12:44 -05:00
committed by GitHub
parent 8f1aba639c
commit ccd47f8465
18 changed files with 580 additions and 558 deletions
+9
View File
@@ -245,4 +245,13 @@ std::string titlize(const std::string& str) {
}
return new_str;
}
std::string pad_right(const std::string& input, const int width, const char padding_char) {
if (input.length() >= width) {
return input; // No need to pad if input length is already greater or equal to width
} else {
int padding_width = width - input.length();
return input + std::string(padding_width, padding_char);
}
}
} // namespace str_util