Remove all tabs ⭾ in *.[ch] and add a CI check for them
There weren't many left, and I happened to have one of these files open and it was distracting. Closes: #839 Approved by: jlebon
This commit is contained in:
parent
46f4b62f3b
commit
7d3b72c814
@ -15,6 +15,7 @@ packages:
|
||||
|
||||
tests:
|
||||
- ci/ci-commitmessage-submodules.sh
|
||||
- ci/codestyle.sh
|
||||
- ci/build-check.sh
|
||||
|
||||
timeout: 30m
|
||||
|
10
ci/codestyle.sh
Executable file
10
ci/codestyle.sh
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
set -xeuo pipefail
|
||||
echo "Checking for tabs:"
|
||||
(git grep -E '^ +' -- '*.[ch]' || true) > tabdamage.txt
|
||||
if test -s tabdamage.txt; then
|
||||
echo "Error: tabs in .[ch] files:"
|
||||
cat tabdamage.txt
|
||||
exit 1
|
||||
fi
|
||||
echo "ok"
|
@ -42,4 +42,4 @@ void rpmostreed_daemon_unpublish (RpmostreedDaemon *self,
|
||||
const gchar *path,
|
||||
gpointer thing);
|
||||
gboolean rpmostreed_reload_config (RpmostreedDaemon *self,
|
||||
GError **error);
|
||||
GError **error);
|
||||
|
@ -35,9 +35,9 @@ rpmostreed_deployment_generate_id (OstreeDeployment *deployment)
|
||||
{
|
||||
g_return_val_if_fail (OSTREE_IS_DEPLOYMENT (deployment), NULL);
|
||||
return g_strdup_printf ("%s-%s.%u",
|
||||
ostree_deployment_get_osname (deployment),
|
||||
ostree_deployment_get_csum (deployment),
|
||||
ostree_deployment_get_deployserial (deployment));
|
||||
ostree_deployment_get_osname (deployment),
|
||||
ostree_deployment_get_csum (deployment),
|
||||
ostree_deployment_get_deployserial (deployment));
|
||||
}
|
||||
|
||||
OstreeDeployment *
|
||||
@ -69,7 +69,7 @@ static GVariant *
|
||||
rpmostreed_deployment_gpg_results (OstreeRepo *repo,
|
||||
const gchar *origin_refspec,
|
||||
const gchar *csum,
|
||||
gboolean *out_enabled)
|
||||
gboolean *out_enabled)
|
||||
{
|
||||
GError *error = NULL;
|
||||
GVariant *ret = NULL;
|
||||
@ -89,7 +89,7 @@ rpmostreed_deployment_gpg_results (OstreeRepo *repo,
|
||||
if (remote)
|
||||
{
|
||||
if (!ostree_repo_remote_get_gpg_verify (repo, remote, &gpg_verify, &error))
|
||||
goto out;
|
||||
goto out;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -102,7 +102,7 @@ rpmostreed_deployment_gpg_results (OstreeRepo *repo,
|
||||
|
||||
result = ostree_repo_verify_commit_for_remote (repo, csum, remote, NULL, &error);
|
||||
if (!result)
|
||||
goto out;
|
||||
goto out;
|
||||
|
||||
n_sigs = ostree_gpg_verify_result_count_all (result);
|
||||
if (n_sigs < 1)
|
||||
@ -197,12 +197,12 @@ rpmostreed_deployment_generate_variant (OstreeSysroot *sysroot,
|
||||
const char *const empty_v[] = { NULL };
|
||||
|
||||
if (!ostree_repo_load_variant (repo,
|
||||
OSTREE_OBJECT_TYPE_COMMIT,
|
||||
csum,
|
||||
&commit,
|
||||
error))
|
||||
OSTREE_OBJECT_TYPE_COMMIT,
|
||||
csum,
|
||||
&commit,
|
||||
error))
|
||||
return NULL;
|
||||
|
||||
|
||||
id = rpmostreed_deployment_generate_id (deployment);
|
||||
|
||||
origin = rpmostree_origin_parse_deployment (deployment, error);
|
||||
@ -309,7 +309,7 @@ GVariant *
|
||||
rpmostreed_commit_generate_cached_details_variant (OstreeDeployment *deployment,
|
||||
OstreeRepo *repo,
|
||||
const gchar *refspec,
|
||||
GError **error)
|
||||
GError **error)
|
||||
{
|
||||
g_autoptr(GVariant) commit = NULL;
|
||||
g_autofree gchar *origin_refspec = NULL;
|
||||
@ -346,10 +346,10 @@ rpmostreed_commit_generate_cached_details_variant (OstreeDeployment *deployment,
|
||||
head = g_strdup (ostree_deployment_get_csum (deployment));
|
||||
|
||||
if (!ostree_repo_load_variant (repo,
|
||||
OSTREE_OBJECT_TYPE_COMMIT,
|
||||
head,
|
||||
&commit,
|
||||
error))
|
||||
OSTREE_OBJECT_TYPE_COMMIT,
|
||||
head,
|
||||
&commit,
|
||||
error))
|
||||
return NULL;
|
||||
|
||||
sigs = rpmostreed_deployment_gpg_results (repo, origin_refspec, head, &gpg_enabled);
|
||||
|
@ -1154,7 +1154,7 @@ os_handle_get_cached_rebase_rpm_diff (RPMOSTreeOS *interface,
|
||||
details = rpmostreed_commit_generate_cached_details_variant (base_deployment,
|
||||
ot_repo,
|
||||
comp_ref,
|
||||
&local_error);
|
||||
&local_error);
|
||||
if (!details)
|
||||
goto out;
|
||||
|
||||
@ -1294,7 +1294,7 @@ os_handle_get_cached_deploy_rpm_diff (RPMOSTreeOS *interface,
|
||||
details = rpmostreed_commit_generate_cached_details_variant (base_deployment,
|
||||
ot_repo,
|
||||
NULL,
|
||||
&local_error);
|
||||
&local_error);
|
||||
if (!details)
|
||||
goto out;
|
||||
|
||||
@ -1306,7 +1306,7 @@ out:
|
||||
else
|
||||
{
|
||||
g_dbus_method_invocation_return_value (invocation,
|
||||
new_variant_diff_result (value, details));
|
||||
new_variant_diff_result (value, details));
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
@ -441,8 +441,8 @@ sysroot_transform_transaction_to_address (GBinding *binding,
|
||||
|
||||
static gboolean
|
||||
sysroot_populate_deployments_unlocked (RpmostreedSysroot *self,
|
||||
gboolean *out_changed,
|
||||
GError **error)
|
||||
gboolean *out_changed,
|
||||
GError **error)
|
||||
{
|
||||
gboolean ret = FALSE;
|
||||
OstreeDeployment *booted = NULL; /* owned by sysroot */
|
||||
@ -465,7 +465,7 @@ sysroot_populate_deployments_unlocked (RpmostreedSysroot *self,
|
||||
}
|
||||
|
||||
repo_changed = !(self->repo_last_stat.st_mtim.tv_sec == repo_new_stat.st_mtim.tv_sec
|
||||
&& self->repo_last_stat.st_mtim.tv_nsec == repo_new_stat.st_mtim.tv_nsec);
|
||||
&& self->repo_last_stat.st_mtim.tv_nsec == repo_new_stat.st_mtim.tv_nsec);
|
||||
if (repo_changed)
|
||||
self->repo_last_stat = repo_new_stat;
|
||||
|
||||
@ -473,7 +473,7 @@ sysroot_populate_deployments_unlocked (RpmostreedSysroot *self,
|
||||
{
|
||||
ret = TRUE;
|
||||
if (out_changed)
|
||||
*out_changed = FALSE;
|
||||
*out_changed = FALSE;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@ -752,7 +752,7 @@ rpmostreed_sysroot_class_init (RpmostreedSysrootClass *klass)
|
||||
|
||||
gboolean
|
||||
rpmostreed_sysroot_reload (RpmostreedSysroot *self,
|
||||
GError **error)
|
||||
GError **error)
|
||||
{
|
||||
gboolean ret = FALSE;
|
||||
gboolean did_change;
|
||||
@ -771,18 +771,18 @@ rpmostreed_sysroot_reload (RpmostreedSysroot *self,
|
||||
|
||||
static void
|
||||
on_deploy_changed (GFileMonitor *monitor,
|
||||
GFile *file,
|
||||
GFile *other_file,
|
||||
GFileMonitorEvent event_type,
|
||||
gpointer user_data)
|
||||
GFile *file,
|
||||
GFile *other_file,
|
||||
GFileMonitorEvent event_type,
|
||||
gpointer user_data)
|
||||
{
|
||||
RpmostreedSysroot *self = RPMOSTREED_SYSROOT (user_data);
|
||||
g_autoptr(GError) error = NULL;
|
||||
|
||||
|
||||
if (event_type == G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED)
|
||||
{
|
||||
if (!rpmostreed_sysroot_reload (self, &error))
|
||||
goto out;
|
||||
goto out;
|
||||
}
|
||||
|
||||
out:
|
||||
@ -809,7 +809,7 @@ rpmostreed_sysroot_iface_init (RPMOSTreeSysrootIface *iface)
|
||||
*/
|
||||
gboolean
|
||||
rpmostreed_sysroot_populate (RpmostreedSysroot *self,
|
||||
GCancellable *cancellable,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
gboolean ret = FALSE;
|
||||
@ -837,7 +837,7 @@ rpmostreed_sysroot_populate (RpmostreedSysroot *self,
|
||||
const char *sysroot_path = gs_file_get_path_cached (ostree_sysroot_get_path (self->ot_sysroot));
|
||||
g_autofree char *sysroot_deploy_path = g_build_filename (sysroot_path, "ostree/deploy", NULL);
|
||||
g_autoptr(GFile) sysroot_deploy = g_file_new_for_path (sysroot_deploy_path);
|
||||
|
||||
|
||||
self->monitor = g_file_monitor (sysroot_deploy, 0, NULL, error);
|
||||
|
||||
if (self->monitor == NULL)
|
||||
@ -856,10 +856,10 @@ out:
|
||||
|
||||
gboolean
|
||||
rpmostreed_sysroot_load_state (RpmostreedSysroot *self,
|
||||
GCancellable *cancellable,
|
||||
OstreeSysroot **out_sysroot,
|
||||
OstreeRepo **out_repo,
|
||||
GError **error)
|
||||
GCancellable *cancellable,
|
||||
OstreeSysroot **out_sysroot,
|
||||
OstreeRepo **out_repo,
|
||||
GError **error)
|
||||
{
|
||||
if (out_sysroot)
|
||||
*out_sysroot = g_object_ref (rpmostreed_sysroot_get_root (self));
|
||||
|
@ -327,7 +327,7 @@ transaction_execute_done_cb (GObject *source_object,
|
||||
if (success)
|
||||
{
|
||||
if (!rpmostreed_sysroot_reload (rpmostreed_sysroot_get (), &local_error))
|
||||
success = FALSE;
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
/* Sanity check */
|
||||
@ -372,7 +372,7 @@ transaction_set_property (GObject *object,
|
||||
{
|
||||
case PROP_INVOCATION:
|
||||
priv->invocation = g_value_dup_object (value);
|
||||
break;
|
||||
break;
|
||||
case PROP_SYSROOT_PATH:
|
||||
priv->sysroot_path = g_value_dup_string (value);
|
||||
break;
|
||||
@ -519,7 +519,7 @@ transaction_initable_init (GInitable *initable,
|
||||
priv->sysroot = ostree_sysroot_new (tmp_path);
|
||||
|
||||
if (!ostree_sysroot_load (priv->sysroot, cancellable, error))
|
||||
goto out;
|
||||
goto out;
|
||||
|
||||
if (!ostree_sysroot_try_lock (priv->sysroot, &lock_acquired, error))
|
||||
goto out;
|
||||
|
@ -226,7 +226,7 @@ rpmostreed_reboot (GCancellable *cancellable, GError **error)
|
||||
{
|
||||
const char *child_argv[] = { "systemctl", "reboot", NULL };
|
||||
(void) g_spawn_sync (NULL, (char**)child_argv, NULL, G_SPAWN_CHILD_INHERITS_STDIN | G_SPAWN_SEARCH_PATH,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -56,7 +56,7 @@ const char *libsd_special_glyph(SpecialGlyph code) {
|
||||
[MDASH] = "\342\200\223", /* – */
|
||||
};
|
||||
|
||||
gboolean locale_is_utf8 = g_get_charset (NULL);
|
||||
gboolean locale_is_utf8 = g_get_charset (NULL);
|
||||
|
||||
if (locale_is_utf8)
|
||||
return draw_table_utf8[code];
|
||||
|
@ -27,9 +27,9 @@
|
||||
|
||||
gboolean
|
||||
_rpmostree_jsonutil_object_get_optional_string_member (JsonObject *object,
|
||||
const char *member_name,
|
||||
const char **out_value,
|
||||
GError **error)
|
||||
const char *member_name,
|
||||
const char **out_value,
|
||||
GError **error)
|
||||
{
|
||||
gboolean ret = FALSE;
|
||||
JsonNode *node = json_object_get_member (object, member_name);
|
||||
@ -54,8 +54,8 @@ _rpmostree_jsonutil_object_get_optional_string_member (JsonObject *object,
|
||||
|
||||
const char *
|
||||
_rpmostree_jsonutil_object_require_string_member (JsonObject *object,
|
||||
const char *member_name,
|
||||
GError **error)
|
||||
const char *member_name,
|
||||
GError **error)
|
||||
{
|
||||
const char *ret;
|
||||
if (!_rpmostree_jsonutil_object_get_optional_string_member (object, member_name, &ret, error))
|
||||
@ -160,8 +160,8 @@ _rpmostree_jsonutil_object_get_optional_boolean_member (JsonObject *object,
|
||||
|
||||
const char *
|
||||
_rpmostree_jsonutil_array_require_string_element (JsonArray *array,
|
||||
guint i,
|
||||
GError **error)
|
||||
guint i,
|
||||
GError **error)
|
||||
{
|
||||
const char *ret = json_array_get_string_element (array, i);
|
||||
if (!ret)
|
||||
@ -195,9 +195,9 @@ _rpmostree_jsonutil_array_require_int_element (JsonArray *array,
|
||||
|
||||
gboolean
|
||||
_rpmostree_jsonutil_append_string_array_to (JsonObject *object,
|
||||
const char *member_name,
|
||||
GPtrArray *array,
|
||||
GError **error)
|
||||
const char *member_name,
|
||||
GPtrArray *array,
|
||||
GError **error)
|
||||
{
|
||||
JsonArray *jarray = json_object_get_array_member (object, member_name);
|
||||
guint i, len;
|
||||
|
Loading…
Reference in New Issue
Block a user