From a2af01bcdad22060a9b1fd52c45810efbcab0015 Mon Sep 17 00:00:00 2001 From: Igor Sirotin Date: Wed, 20 Mar 2024 20:08:43 +0000 Subject: [PATCH] chore: force some warnings as errors (#14068) --- Makefile | 3 --- config.nims | 11 +++++++++++ .../shared_modules/keycard_popup/controller.nim | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 254b052d94..585bfe8d52 100644 --- a/Makefile +++ b/Makefile @@ -546,9 +546,6 @@ $(NIM_STATUS_CLIENT): $(NIM_SOURCES) | statusq dotherside check-qt-dir $(STATUSG --passL:"-lkeycard" \ --passL:"$(QRCODEGEN)" \ --passL:"-lm" \ - --warning:UnreachableElse:off \ - --warningAsError:UseBase:on \ - --warningAsError:UnusedImport:on \ $(NIM_EXTRA_PARAMS) src/nim_status_client.nim ifeq ($(detected_OS),Darwin) install_name_tool -change \ diff --git a/config.nims b/config.nims index 8506c80391..640ba6c5af 100644 --- a/config.nims +++ b/config.nims @@ -48,3 +48,14 @@ switch("warning", "LockLevel:off") # No clean workaround for this warning in certain cases, waiting for better upstream support switch("warning", "BareExcept:off") + +# We assume this as a good practive to keep `else` even if all cases are covered +switch("warning", "UnreachableElse:off") + +# Those are popular to miss in our app, and quickly make build log unreadable, so we want to prevent them +switch("warningAsError", "UseBase:on") +switch("warningAsError", "UnusedImport:on") + +# Workaround for https://github.com/nim-lang/Nim/issues/23429 +switch("warning", "UseBase:on") +switch("warning", "UnusedImport:on") diff --git a/src/app/modules/shared_modules/keycard_popup/controller.nim b/src/app/modules/shared_modules/keycard_popup/controller.nim index 50f877c9f3..608cb7b23c 100644 --- a/src/app/modules/shared_modules/keycard_popup/controller.nim +++ b/src/app/modules/shared_modules/keycard_popup/controller.nim @@ -1,5 +1,5 @@ import chronicles, tables, strutils, sequtils, stint -import uuids, sets, sugar +import uuids import io_interface import app/global/app_sections_config as conf