aboutsummaryrefslogtreecommitdiffhomepage
path: root/gobject-linter.toml
blob: 7c68c747e9e7719a7fcbd4d063f70e3a36b2a8ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# gobject-linter configuration
# https://github.com/bilelmoussaoui/gobject-linter
#
# Run locally with:   gobject-linter .
# Auto-fix:           gobject-linter . --fix
#
# CI runs this as a blocking gate (see .github/workflows/gobject-linter.yml):
# every enabled rule is a hard error, so the build fails on any regression.

# libadwaita >= 1.8 pulls in GLib >= 2.80; rules needing a newer GLib are skipped.
min_glib_version = "2.80"

# Treat every enabled, non-opt-in rule as an error so CI fails on new findings.
default_level = "error"

# This project deliberately uses the standard C scalar types (int/char/…) rather
# than the GLib aliases (gint/gchar/…). The alias style is not enforced.
[rules.type_style]
level = "ignore"

# The application is internationalized via gettext (see po/). Enforce that every
# user-visible string is wrapped with _() so new strings stay translatable.
[rules.untranslated_string]
level = "error"

# Advisory only: this rule mis-fires on floating GVariant references (consumed by
# g_variant_new_tuple/builders) and on objects intentionally kept alive past the
# function (e.g. the GlobalShortcuts GDBusProxy). Converting those to g_autoptr
# would over-unref and crash, so it reports rather than blocks. Convert the safe
# g_autofree/g_autoptr sites manually over time.
#
# global_shortcuts.c is the D-Bus portal plumbing: every finding there is one of
# the false positives above (floating GVariants sunk by g_variant_new_tuple,
# GVariant* arrays, or the deliberately long-lived request proxy), so the rule is
# excluded for that file entirely.
[rules.use_auto_cleanup]
level = "warn"
ignore = ["src/global_shortcuts.c"]