Configure clang-format
This configures the clang-format utility for automated code formatting.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/.clang-format Mon Feb 10 21:43:50 2020 -0600
@@ -0,0 +1,65 @@
+# TODO: Consider changing to AlwaysBreak for shorter lines. +# TODO: This would also be more consistent with the manual formatting of +# TODO: functions like g_object_get(). If we use that, we could remove +# TODO: the "clang-format off" for gtk_widget_class_bind_template_child +# TODO: in gplugin-gtk/gplugin-gtk-plugin-info.c. +AlignAfterOpenBracket: Align +AlignConsecutiveAssignments: false +AlignConsecutiveDeclarations: false +#AlignConsecutiveMacros: true +AlignEscapedNewlines: DontAlign +AllowShortBlocksOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: None +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterReturnType: All + AfterControlStatement: false + # TODO: There are quite a few "true" here. + AfterObjCDeclaration: false + # TODO: There are some "true" here. If changed, change Enum and Union. + AfterExternBlock: false + SplitEmptyFunction: true + SplitEmptyRecord: false + SplitEmptyNamespace: true +BreakBeforeBraces: Custom +ContinuationIndentWidth: 4 +#DeriveLineEnding: false +DerivePointerAlignment: false +#IndentCaseBlocks: false +#IndentGotoLabels: false +IndentWrappedFunctionNames: false +SpaceAfterCStyleCast: false +# TODO: This is roughly 50/50 with ControlStatements +SpaceBeforeParens: Never +#SpaceBeforeSquareBrackets: false +#SpaceInEmptyBlock: false +SpaceInEmptyParentheses: false +SpacesInCStyleCastParentheses: false +#SpacesInConditionalStatement: false +SpacesInContainerLiterals: false +SpacesInParentheses: false +SpacesInSquareBrackets: false --- a/gplugin-gtk-viewer/gplugin-gtk-viewer.c Mon Feb 10 02:28:15 2020 -0600
+++ b/gplugin-gtk-viewer/gplugin-gtk-viewer.c Mon Feb 10 21:43:50 2020 -0600
@@ -138,6 +138,7 @@
/******************************************************************************
*****************************************************************************/
static GOptionEntry entries[] = {
"internal", 'i', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
@@ -159,6 +160,7 @@
NULL, 0, 0, 0, NULL, NULL, NULL,
main(gint argc, gchar **argv) {
--- a/gplugin-gtk/gplugin-gtk-plugin-info.c Mon Feb 10 02:28:15 2020 -0600
+++ b/gplugin-gtk/gplugin-gtk-plugin-info.c Mon Feb 10 21:43:50 2020 -0600
@@ -125,6 +125,7 @@
g_object_unref(G_OBJECT(plugin_loader));
g_object_get(G_OBJECT(plugin_info),
"abi_version", &abi_version_uint,
@@ -137,6 +138,7 @@
/* fanagle the plugin name */
markup = g_markup_printf_escaped("<span font_size=\"large\" "
@@ -266,6 +268,7 @@
"/org/bitbucket/gplugin/gplugin-gtk/plugin-info.ui"
gtk_widget_class_bind_template_child(widget_class, GPluginGtkPluginInfo, name);
gtk_widget_class_bind_template_child(widget_class, GPluginGtkPluginInfo, version);
gtk_widget_class_bind_template_child(widget_class, GPluginGtkPluginInfo, authors_box);
@@ -280,6 +283,7 @@
gtk_widget_class_bind_template_child(widget_class, GPluginGtkPluginInfo, loader);
gtk_widget_class_bind_template_child(widget_class, GPluginGtkPluginInfo, internal);
gtk_widget_class_bind_template_child(widget_class, GPluginGtkPluginInfo, load_on_query);
gtk_widget_class_bind_template_callback(widget_class, gplugin_gtk_plugin_info_expander_activate);
--- a/gplugin-gtk/gplugin-gtk-store.c Mon Feb 10 02:28:15 2020 -0600
+++ b/gplugin-gtk/gplugin-gtk-store.c Mon Feb 10 21:43:50 2020 -0600
@@ -76,10 +76,12 @@
GString *str = g_string_new("");
gchar *name = NULL, *summary = NULL;
g_object_get(G_OBJECT(info),
g_string_append_printf(str, "<b>%s</b>\n",
(name) ? name : "<i>Unnamed</i>");
--- a/gplugin/gplugin-native-loader.c Mon Feb 10 02:28:15 2020 -0600
+++ b/gplugin/gplugin-native-loader.c Mon Feb 10 21:43:50 2020 -0600
@@ -226,6 +226,7 @@
g_object_ref_sink(G_OBJECT(info));
/* now create the actual plugin instance */
plugin = g_object_new(GPLUGIN_TYPE_NATIVE_PLUGIN,
@@ -234,6 +235,7 @@
/* now that the plugin instance owns the info, remove our ref */
g_object_unref(G_OBJECT(info));
--- a/gplugin/gplugin-options.c Mon Feb 10 02:28:15 2020 -0600
+++ b/gplugin/gplugin-options.c Mon Feb 10 21:43:50 2020 -0600
@@ -51,6 +51,7 @@
static GOptionEntry entries[] = {
"no-default-paths", 'D', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
@@ -65,6 +66,7 @@
NULL, 0, 0, 0, NULL, NULL, NULL
gplugin_options_post_parse_cb(G_GNUC_UNUSED GOptionContext *ctx,
--- a/gplugin/gplugin-plugin-info.h Mon Feb 10 02:28:15 2020 -0600
+++ b/gplugin/gplugin-plugin-info.h Mon Feb 10 21:43:50 2020 -0600
@@ -40,13 +40,13 @@
#define gplugin_plugin_info_new(id, abi_version, ...) \
- g_object_new(GPLUGIN_TYPE_PLUGIN_INFO, \
- "abi-version", (abi_version), \
+ GPLUGIN_PLUGIN_INFO(g_object_new(GPLUGIN_TYPE_PLUGIN_INFO, \ + "abi-version", (abi_version), \ const gchar *gplugin_plugin_info_get_id(GPluginPluginInfo *info);
guint32 gplugin_plugin_info_get_abi_version(GPluginPluginInfo *info);
--- a/gplugin/gplugin-query.c Mon Feb 10 02:28:15 2020 -0600
+++ b/gplugin/gplugin-query.c Mon Feb 10 21:43:50 2020 -0600
@@ -130,6 +130,7 @@
g_object_get(G_OBJECT(info),
"abi-version", &abi_version,
@@ -146,6 +147,7 @@
"dependencies", &dependencies,
@@ -246,6 +248,7 @@
/******************************************************************************
*****************************************************************************/
static GOptionEntry entries[] = {
"internal", 'i', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
@@ -271,6 +274,7 @@
NULL, 0, 0, 0, NULL, NULL, NULL,
main(gint argc, gchar **argv) {
--- a/gplugin/tests/bind-local/bind-local.c Mon Feb 10 02:28:15 2020 -0600
+++ b/gplugin/tests/bind-local/bind-local.c Mon Feb 10 21:43:50 2020 -0600
@@ -20,12 +20,13 @@
G_MODULE_EXPORT GPluginPluginInfo *
gplugin_query(G_GNUC_UNUSED GError **error) {
return gplugin_plugin_info_new(
--- a/gplugin/tests/dynamic-type/dynamic-type-user.c Mon Feb 10 02:28:15 2020 -0600
+++ b/gplugin/tests/dynamic-type/dynamic-type-user.c Mon Feb 10 21:43:50 2020 -0600
@@ -29,12 +29,13 @@
return gplugin_plugin_info_new(
"gplugin/dynamic-type-user",
GPLUGIN_NATIVE_PLUGIN_ABI_VERSION,
"dependencies", dependencies,
--- a/gplugin/tests/id-collision/id-collision1.c Mon Feb 10 02:28:15 2020 -0600
+++ b/gplugin/tests/id-collision/id-collision1.c Mon Feb 10 21:43:50 2020 -0600
@@ -20,12 +20,13 @@
G_MODULE_EXPORT GPluginPluginInfo *
gplugin_query(G_GNUC_UNUSED GError **error) {
return gplugin_plugin_info_new(
GPLUGIN_NATIVE_PLUGIN_ABI_VERSION,
--- a/gplugin/tests/id-collision/id-collision2.c Mon Feb 10 02:28:15 2020 -0600
+++ b/gplugin/tests/id-collision/id-collision2.c Mon Feb 10 21:43:50 2020 -0600
@@ -20,12 +20,13 @@
G_MODULE_EXPORT GPluginPluginInfo *
gplugin_query(G_GNUC_UNUSED GError **error) {
return gplugin_plugin_info_new(
GPLUGIN_NATIVE_PLUGIN_ABI_VERSION,
--- a/gplugin/tests/load-on-query-fail/load-on-query-fail.c Mon Feb 10 02:28:15 2020 -0600
+++ b/gplugin/tests/load-on-query-fail/load-on-query-fail.c Mon Feb 10 21:43:50 2020 -0600
@@ -20,12 +20,13 @@
G_MODULE_EXPORT GPluginPluginInfo *
gplugin_query(G_GNUC_UNUSED GError **error) {
return gplugin_plugin_info_new(
"gplugin/load-on-query-fail",
GPLUGIN_NATIVE_PLUGIN_ABI_VERSION,
--- a/gplugin/tests/load-on-query-pass/load-on-query-pass.c Mon Feb 10 02:28:15 2020 -0600
+++ b/gplugin/tests/load-on-query-pass/load-on-query-pass.c Mon Feb 10 21:43:50 2020 -0600
@@ -20,12 +20,13 @@
G_MODULE_EXPORT GPluginPluginInfo *
gplugin_query(G_GNUC_UNUSED GError **error) {
return gplugin_plugin_info_new(
GPLUGIN_NATIVE_PLUGIN_ABI_VERSION,
--- a/gplugin/tests/plugins/basic-plugin.c Mon Feb 10 02:28:15 2020 -0600
+++ b/gplugin/tests/plugins/basic-plugin.c Mon Feb 10 21:43:50 2020 -0600
@@ -25,6 +25,7 @@
return gplugin_plugin_info_new(
"gplugin/native-basic-plugin",
@@ -36,8 +37,8 @@
"description", "description",
--- a/gplugin/tests/plugins/broken-dependent-plugin.c Mon Feb 10 02:28:15 2020 -0600
+++ b/gplugin/tests/plugins/broken-dependent-plugin.c Mon Feb 10 21:43:50 2020 -0600
@@ -25,12 +25,13 @@
return gplugin_plugin_info_new(
"gplugin/broken-dependent-native-plugin",
GPLUGIN_NATIVE_PLUGIN_ABI_VERSION,
"dependencies", dependencies,
--- a/gplugin/tests/plugins/dependent-plugin.c Mon Feb 10 02:28:15 2020 -0600
+++ b/gplugin/tests/plugins/dependent-plugin.c Mon Feb 10 21:43:50 2020 -0600
@@ -26,12 +26,13 @@
return gplugin_plugin_info_new(
"gplugin/native-dependent-plugin",
GPLUGIN_NATIVE_PLUGIN_ABI_VERSION,
"dependencies", dependencies,
--- a/gplugin/tests/plugins/load-exception.c Mon Feb 10 02:28:15 2020 -0600
+++ b/gplugin/tests/plugins/load-exception.c Mon Feb 10 21:43:50 2020 -0600
@@ -23,8 +23,7 @@
return gplugin_plugin_info_new(
"gplugin/native-load-exception",
GPLUGIN_NATIVE_PLUGIN_ABI_VERSION,
--- a/gplugin/tests/test-plugin-info.c Mon Feb 10 02:28:15 2020 -0600
+++ b/gplugin/tests/test-plugin-info.c Mon Feb 10 21:43:50 2020 -0600
@@ -86,6 +86,7 @@
const gchar * const r_authors[] = { "author", NULL };
const gchar * const r_dependencies[] = { "dependency", NULL };
info = g_object_new(GPLUGIN_TYPE_PLUGIN_INFO,
"id", "gplugin-test/plugin-info-test",
"abi_version", GPLUGIN_NATIVE_PLUGIN_ABI_VERSION,
@@ -104,11 +105,12 @@
"dependencies", r_dependencies,
g_assert_true(GPLUGIN_IS_PLUGIN_INFO(info));
g_object_get(G_OBJECT(info),
"abi_version", &abi_version,
@@ -127,8 +129,8 @@
"dependencies", &dependencies,
test_string(id, "gplugin-test/plugin-info-test");
test_uint(abi_version, GPLUGIN_NATIVE_PLUGIN_ABI_VERSION);
@@ -161,10 +163,12 @@
g_assert_true(GPLUGIN_IS_PLUGIN_INFO(info));
g_object_get(G_OBJECT(info),
"abi-version", &abi_version,
test_string(id, "empty");
test_uint(abi_version, 1);
@@ -185,6 +189,7 @@
const gchar * const r_authors[] = { "author", NULL };
const gchar * const r_dependencies[] = { "dependency", NULL };
info = gplugin_plugin_info_new(
"gplugin-test/plugin-info-test",
GPLUGIN_NATIVE_PLUGIN_ABI_VERSION,
@@ -203,11 +208,12 @@
"dependencies", r_dependencies,
g_assert_true(GPLUGIN_IS_PLUGIN_INFO(info));
g_object_get(G_OBJECT(info),
"abi_version", &abi_version,
@@ -226,8 +232,8 @@
"dependencies", &dependencies,
test_string(id, "gplugin-test/plugin-info-test");
test_uint(abi_version, GPLUGIN_NATIVE_PLUGIN_ABI_VERSION);
--- a/gplugin/tests/versioned-dependencies/bar.c Mon Feb 10 02:28:15 2020 -0600
+++ b/gplugin/tests/versioned-dependencies/bar.c Mon Feb 10 21:43:50 2020 -0600
@@ -20,12 +20,13 @@
G_MODULE_EXPORT GPluginPluginInfo *
gplugin_query(G_GNUC_UNUSED GError **error) {
return gplugin_plugin_info_new(
--- a/gplugin/tests/versioned-dependencies/baz.c Mon Feb 10 02:28:15 2020 -0600
+++ b/gplugin/tests/versioned-dependencies/baz.c Mon Feb 10 21:43:50 2020 -0600
@@ -20,12 +20,13 @@
G_MODULE_EXPORT GPluginPluginInfo *
gplugin_query(G_GNUC_UNUSED GError **error) {
return gplugin_plugin_info_new(
--- a/gplugin/tests/versioned-dependencies/exact1.c Mon Feb 10 02:28:15 2020 -0600
+++ b/gplugin/tests/versioned-dependencies/exact1.c Mon Feb 10 21:43:50 2020 -0600
@@ -20,12 +20,13 @@
G_MODULE_EXPORT GPluginPluginInfo *
gplugin_query(G_GNUC_UNUSED GError **error) {
return gplugin_plugin_info_new(
--- a/gplugin/tests/versioned-dependencies/exact2.c Mon Feb 10 02:28:15 2020 -0600
+++ b/gplugin/tests/versioned-dependencies/exact2.c Mon Feb 10 21:43:50 2020 -0600
@@ -20,12 +20,13 @@
G_MODULE_EXPORT GPluginPluginInfo *
gplugin_query(G_GNUC_UNUSED GError **error) {
return gplugin_plugin_info_new(
--- a/gplugin/tests/versioned-dependencies/fez.c Mon Feb 10 02:28:15 2020 -0600
+++ b/gplugin/tests/versioned-dependencies/fez.c Mon Feb 10 21:43:50 2020 -0600
@@ -20,12 +20,13 @@
G_MODULE_EXPORT GPluginPluginInfo *
gplugin_query(G_GNUC_UNUSED GError **error) {
return gplugin_plugin_info_new(
--- a/gplugin/tests/versioned-dependencies/greater-equal.c Mon Feb 10 02:28:15 2020 -0600
+++ b/gplugin/tests/versioned-dependencies/greater-equal.c Mon Feb 10 21:43:50 2020 -0600
@@ -20,12 +20,13 @@
G_MODULE_EXPORT GPluginPluginInfo *
gplugin_query(G_GNUC_UNUSED GError **error) {
return gplugin_plugin_info_new(
"gplugin/test-greater-equal",
--- a/gplugin/tests/versioned-dependencies/greater.c Mon Feb 10 02:28:15 2020 -0600
+++ b/gplugin/tests/versioned-dependencies/greater.c Mon Feb 10 21:43:50 2020 -0600
@@ -20,12 +20,13 @@
G_MODULE_EXPORT GPluginPluginInfo *
gplugin_query(G_GNUC_UNUSED GError **error) {
return gplugin_plugin_info_new(
--- a/gplugin/tests/versioned-dependencies/less-equal.c Mon Feb 10 02:28:15 2020 -0600
+++ b/gplugin/tests/versioned-dependencies/less-equal.c Mon Feb 10 21:43:50 2020 -0600
@@ -20,12 +20,13 @@
G_MODULE_EXPORT GPluginPluginInfo *
gplugin_query(G_GNUC_UNUSED GError **error) {
return gplugin_plugin_info_new(
"gplugin/test-less-equal",
--- a/gplugin/tests/versioned-dependencies/less.c Mon Feb 10 02:28:15 2020 -0600
+++ b/gplugin/tests/versioned-dependencies/less.c Mon Feb 10 21:43:50 2020 -0600
@@ -20,12 +20,13 @@
G_MODULE_EXPORT GPluginPluginInfo *
gplugin_query(G_GNUC_UNUSED GError **error) {
return gplugin_plugin_info_new(
--- a/gplugin/tests/versioned-dependencies/super-dependent.c Mon Feb 10 02:28:15 2020 -0600
+++ b/gplugin/tests/versioned-dependencies/super-dependent.c Mon Feb 10 21:43:50 2020 -0600
@@ -34,13 +34,14 @@
return gplugin_plugin_info_new(
"gplugin/super-dependent",
"name", "super dependent",
"dependencies", dependencies,
--- a/lua/gplugin-lua-core.c Mon Feb 10 02:28:15 2020 -0600
+++ b/lua/gplugin-lua-core.c Mon Feb 10 21:43:50 2020 -0600
@@ -31,6 +31,7 @@
return gplugin_plugin_info_new(
GPLUGIN_NATIVE_PLUGIN_ABI_VERSION,
@@ -45,8 +46,8 @@
"website", GPLUGIN_WEBSITE,
--- a/lua/gplugin-lua-loader.c Mon Feb 10 02:28:15 2020 -0600
+++ b/lua/gplugin-lua-loader.c Mon Feb 10 21:43:50 2020 -0600
@@ -131,12 +131,14 @@
info = lua_touserdata(L, -1);
plugin = g_object_new(GPLUGIN_LUA_TYPE_PLUGIN,
--- a/perl/gplugin-perl-core.c Mon Feb 10 02:28:15 2020 -0600
+++ b/perl/gplugin-perl-core.c Mon Feb 10 21:43:50 2020 -0600
@@ -28,6 +28,7 @@
return gplugin_plugin_info_new(
GPLUGIN_NATIVE_PLUGIN_ABI_VERSION,
@@ -42,8 +43,8 @@
"website", GPLUGIN_WEBSITE,
--- a/python/gplugin-python-core.c Mon Feb 10 02:28:15 2020 -0600
+++ b/python/gplugin-python-core.c Mon Feb 10 21:43:50 2020 -0600
@@ -30,6 +30,7 @@
return gplugin_plugin_info_new(
GPLUGIN_NATIVE_PLUGIN_ABI_VERSION,
@@ -44,8 +45,8 @@
"website", GPLUGIN_WEBSITE,
--- a/python/gplugin-python-loader.c Mon Feb 10 02:28:15 2020 -0600
+++ b/python/gplugin-python-loader.c Mon Feb 10 21:43:50 2020 -0600
@@ -169,6 +169,7 @@
info = pygobject_get(pyinfo);
/* now that we have everything, create the plugin */
plugin = g_object_new(GPLUGIN_PYTHON_TYPE_PLUGIN,
@@ -177,6 +178,7 @@
--- a/tcc/gplugin-tcc-core.c Mon Feb 10 02:28:15 2020 -0600
+++ b/tcc/gplugin-tcc-core.c Mon Feb 10 21:43:50 2020 -0600
@@ -31,6 +31,7 @@
return gplugin_plugin_info_new(
GPLUGIN_NATIVE_PLUGIN_ABI_VERSION,
@@ -44,8 +45,8 @@
"website", GPLUGIN_WEBSITE,
--- a/tcc/gplugin-tcc-loader.c Mon Feb 10 02:28:15 2020 -0600
+++ b/tcc/gplugin-tcc-loader.c Mon Feb 10 21:43:50 2020 -0600
@@ -98,6 +98,7 @@
plugin = g_object_new(GPLUGIN_TCC_TYPE_PLUGIN,
@@ -105,6 +106,7 @@
--- a/tcc/tests/plugins/basic-plugin.c Mon Feb 10 02:28:15 2020 -0600
+++ b/tcc/tests/plugins/basic-plugin.c Mon Feb 10 21:43:50 2020 -0600
@@ -24,6 +24,7 @@
return gplugin_plugin_info_new(
"gplugin/native-basic-plugin",
@@ -35,8 +36,8 @@
"description", "description",
--- a/tcc/tests/plugins/dependent.c Mon Feb 10 02:28:15 2020 -0600
+++ b/tcc/tests/plugins/dependent.c Mon Feb 10 21:43:50 2020 -0600
@@ -25,12 +25,13 @@
return gplugin_plugin_info_new(
"gplugin/native-dependent-plugin",
GPLUGIN_NATIVE_PLUGIN_ABI_VERSION,
"dependencies", dependencies,