From 6a830f18127936622855f4a1ff5b9b6e6f756342 Mon Sep 17 00:00:00 2001 From: CodeMyst Date: Thu, 19 Mar 2020 14:09:42 +0100 Subject: [PATCH 1/3] ignore warnings with @suppress(key) comments --- src/dscanner/analysis/base.d | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/dscanner/analysis/base.d b/src/dscanner/analysis/base.d index 0b92a5c2..7e1312f5 100644 --- a/src/dscanner/analysis/base.d +++ b/src/dscanner/analysis/base.d @@ -88,6 +88,17 @@ protected: void addErrorMessage(size_t line, size_t column, string key, string message) { + import std.file : readText; + import std.array : split; + import std.ascii : newline; + import std.algorithm : canFind; + + string l = readText(fileName).split(newline)[line-1]; + if (l.canFind("@suppress(" ~ key ~ ")")) + { + return; + } + _messages.insert(Message(fileName, line, column, key, message, getName())); } From f05ba5d0f789aa4da58ee5ecc9cba57419e564e1 Mon Sep 17 00:00:00 2001 From: CodeMyst Date: Thu, 19 Mar 2020 14:20:34 +0100 Subject: [PATCH 2/3] check for warnings only if the file exists --- src/dscanner/analysis/base.d | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/dscanner/analysis/base.d b/src/dscanner/analysis/base.d index 7e1312f5..e0fdbd7f 100644 --- a/src/dscanner/analysis/base.d +++ b/src/dscanner/analysis/base.d @@ -88,15 +88,18 @@ protected: void addErrorMessage(size_t line, size_t column, string key, string message) { - import std.file : readText; + import std.file : readText, exists; import std.array : split; import std.ascii : newline; import std.algorithm : canFind; - string l = readText(fileName).split(newline)[line-1]; - if (l.canFind("@suppress(" ~ key ~ ")")) + if (exists(fileName)) { - return; + string l = readText(fileName).split(newline)[line-1]; + if (l.canFind("@suppress(" ~ key ~ ")")) + { + return; + } } _messages.insert(Message(fileName, line, column, key, message, getName())); From caa16aa325f1dc60ebebc3d095a23a0017dda5b3 Mon Sep 17 00:00:00 2001 From: CodeMyst Date: Thu, 30 Apr 2020 14:52:37 +0200 Subject: [PATCH 3/3] merged master and removed old code --- dsymbol | 2 +- libddoc | 2 +- libdparse | 2 +- src/dscanner/analysis/base.d | 14 -------------- 4 files changed, 3 insertions(+), 17 deletions(-) diff --git a/dsymbol b/dsymbol index ceea154b..62d9030a 160000 --- a/dsymbol +++ b/dsymbol @@ -1 +1 @@ -Subproject commit ceea154b0047f71e4ffec224096ce87015578a8a +Subproject commit 62d9030ae12ae02b2ba247c500502434facc2ac8 diff --git a/libddoc b/libddoc index d50190b7..eb582ed5 160000 --- a/libddoc +++ b/libddoc @@ -1 +1 @@ -Subproject commit d50190b7e33b11d7fec05e504549f0f285bd2232 +Subproject commit eb582ed53d8cee3933140c9593c6401e6b9ac1d4 diff --git a/libdparse b/libdparse index 597d9a69..63559db5 160000 --- a/libdparse +++ b/libdparse @@ -1 +1 @@ -Subproject commit 597d9a697b1f8a51fb2f441c61d0c6cc4eadc6d1 +Subproject commit 63559db5cc6fa38c01bdda36e09638b5f20fb8e5 diff --git a/src/dscanner/analysis/base.d b/src/dscanner/analysis/base.d index e0fdbd7f..0b92a5c2 100644 --- a/src/dscanner/analysis/base.d +++ b/src/dscanner/analysis/base.d @@ -88,20 +88,6 @@ protected: void addErrorMessage(size_t line, size_t column, string key, string message) { - import std.file : readText, exists; - import std.array : split; - import std.ascii : newline; - import std.algorithm : canFind; - - if (exists(fileName)) - { - string l = readText(fileName).split(newline)[line-1]; - if (l.canFind("@suppress(" ~ key ~ ")")) - { - return; - } - } - _messages.insert(Message(fileName, line, column, key, message, getName())); }