|
Add gobject-linter (github.com/bilelmoussaoui/gobject-linter) to CI to catch
GObject/GLib correctness and idiom issues.
Config (gobject-linter.toml):
- min_glib_version = 2.80 (libadwaita >= 1.8)
- default_level = error: every enabled rule blocks CI
- type_style ignored: the project deliberately uses plain C scalar types
- untranslated_string ignored: app is not internationalized yet
- use_auto_cleanup downgraded to warn: it mis-fires on floating GVariant
references (consumed by g_variant_new_tuple/builders) and on objects kept
alive past the function (the GlobalShortcuts GDBusProxy); converting those to
g_autoptr would over-unref and crash, so it advises rather than blocks
Workflow (.github/workflows/gobject-linter.yml): runs the official container
image on push/PR, uploads SARIF to code scanning (non-fatal for fork PRs), and
fails the build on any error-level finding.
Code is brought to a green baseline by applying the auto-fixable findings:
- strcmp -> g_strcmp0 (NULL-safe)
- manual g_free/g_strdup -> g_set_str
- manual source removal -> g_clear_handle_id / g_clear_object / g_clear_pointer
- g_string_free(.., FALSE) -> g_string_free_and_steal
- g_idle_add one-shot -> g_idle_add_once (id now stored and cleared in finalize,
also closing a latent use-after-free if the window is finalized first)
- include ordering and #pragma once
The 37 remaining use_auto_cleanup findings are reported as warnings for
incremental manual review.
|
|
- Version 6.0.0 → 1.0.0, C standard gnu17 → gnu23
- Fix desktop file path (was referencing parent directory)
- global_shortcuts.c: fix systematic GVariant/GDBusProxy leaks, guint64-to-gchar*
type mismatch, buffer overflow risk, missing malloc NULL checks, debug artifacts
- gsr-window.c: fix notification timeout use-after-free, menu object leak in
finalize, localtime NULL check, extract active_mode_to_string helper
- gsr-stream-page.c, gsr-record-page.c, gsr-replay-page.c: fix timer source
leak in finalize (use-after-free if destroyed while timer running)
- gsr-shortcut-accel-dialog.c: fix Pango markup injection via shortcut titles
- gsr-info.c: fix pclose UB, replace fprintf with g_warning
- gsr-config.c: include errno in fopen failure warning
- Remove unused include, stale Phase 5 comments
|