From 5f1c9849bf7044aa25f55a64b248b65d6aad2160 Mon Sep 17 00:00:00 2001 From: Sijawusz Pur Rahnama Date: Sun, 11 Jan 2026 23:14:50 +0100 Subject: [PATCH] Use inline disable pragma --- .ameba.yml | 5 ----- src/invidious/database/base.cr | 1 + 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.ameba.yml b/.ameba.yml index 05229d109..8a792e179 100644 --- a/.ameba.yml +++ b/.ameba.yml @@ -14,11 +14,6 @@ Lint/UselessAssign: - src/invidious/helpers/errors.cr - src/invidious/routes/**/*.cr -# Ignore false negative (if !db.query_one?...) -Lint/UnreachableCode: - Excluded: - - src/invidious/database/base.cr - # Ignore shadowed variable `key` (it works for now, and that's # a sensitive part of the code) Lint/ShadowingOuterLocalVar: diff --git a/src/invidious/database/base.cr b/src/invidious/database/base.cr index 0fb1b6af0..85ff620b7 100644 --- a/src/invidious/database/base.cr +++ b/src/invidious/database/base.cr @@ -32,6 +32,7 @@ module Invidious::Database def check_enum(enum_name, struct_type = nil) return # TODO + # ameba:disable Lint/UnreachableCode if !PG_DB.query_one?("SELECT true FROM pg_type WHERE typname = $1", enum_name, as: Bool) LOGGER.info("check_enum: CREATE TYPE #{enum_name}")