You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2021/06/02 15:18:12 UTC

[GitHub] [nifi-minifi-cpp] martinzink commented on a change in pull request #1089: MINIFICPP-1567 enable linter checks in extensions (part 1)

martinzink commented on a change in pull request #1089:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1089#discussion_r644067626



##########
File path: extensions/coap/controllerservice/CoapConnector.h
##########
@@ -15,8 +15,12 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef LIBMINIFI_INCLUDE_CONTROLLERS_COAPCONNECTOR_H_
-#define LIBMINIFI_INCLUDE_CONTROLLERS_COAPCONNECTOR_H_
+#pragma once
+
+#include <memory>
+#include <string>
+#include <unordered_map>

Review comment:
       thanks, fixed in [95aeacd](https://github.com/martinzink/nifi-minifi-cpp/commit/95aeacd78262361de87609058f1f208b01e4fe3b)

##########
File path: extensions/coap/controllerservice/CoapMessaging.h
##########
@@ -15,15 +15,16 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef EXTENSIONS_COAP_CONTROLLERSERVICE_COAPMESSAGING_H_
-#define EXTENSIONS_COAP_CONTROLLERSERVICE_COAPMESSAGING_H_
+#pragma once
+
+#include <unordered_map>
+#include <memory>
+#include <utility>

Review comment:
       thanks, fixed in [95aeacd](https://github.com/martinzink/nifi-minifi-cpp/commit/95aeacd78262361de87609058f1f208b01e4fe3b)

##########
File path: extensions/coap/nanofi/coap_functions.h
##########
@@ -25,12 +25,13 @@ extern "C" {
 
 typedef unsigned char method_t;
 
+#include <stdio.h>
+#include <string.h>

Review comment:
       thanks, fixed in [95aeacd](https://github.com/martinzink/nifi-minifi-cpp/commit/95aeacd78262361de87609058f1f208b01e4fe3b)

##########
File path: extensions/coap/protocols/CoapC2Protocol.h
##########
@@ -15,8 +15,10 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef EXTENSIONS_COAPPROTOCOL_H_
-#define EXTENSIONS_COAPPROTOCOL_H_
+#pragma once
+
+#include <stdio.h>
+#include <string.h>

Review comment:
       thanks, fixed in [95aeacd](https://github.com/martinzink/nifi-minifi-cpp/commit/95aeacd78262361de87609058f1f208b01e4fe3b)

##########
File path: extensions/coap/server/CoapServer.cpp
##########
@@ -17,6 +17,7 @@
  */
 #include "CoapServer.h"
 #include <coap2/coap.h>
+#include <map>

Review comment:
       thanks, fixed in [95aeacd](https://github.com/martinzink/nifi-minifi-cpp/commit/95aeacd78262361de87609058f1f208b01e4fe3b)

##########
File path: extensions/coap/server/CoapServer.h
##########
@@ -16,16 +16,20 @@
  * limitations under the License.
  */
 
-#ifndef EXTENSIONS_COAP_SERVER_COAPSERVER_H_
-#define EXTENSIONS_COAP_SERVER_COAPSERVER_H_
+#pragma once
 
-#include "core/Connectable.h"
-#include "coap_server.h"
-#include "coap_message.h"
 #include <coap2/coap.h>
 #include <functional>
 #include <thread>
 #include <future>
+#include <map>
+#include <memory>
+#include <string>
+#include <utility>

Review comment:
       thanks, fixed in [95aeacd](https://github.com/martinzink/nifi-minifi-cpp/commit/95aeacd78262361de87609058f1f208b01e4fe3b)

##########
File path: extensions/windows-event-log/Bookmark.cpp
##########
@@ -19,6 +19,8 @@
 #include "Bookmark.h"
 
 #include <direct.h>
+#include <vector>
+#include <unordered_map>

Review comment:
       thanks, fixed in [95aeacd](https://github.com/martinzink/nifi-minifi-cpp/commit/95aeacd78262361de87609058f1f208b01e4fe3b)

##########
File path: extensions/windows-event-log/wel/XMLString.h
##########
@@ -20,18 +20,22 @@
 
 #pragma once
 
-#include "core/Core.h"
-#include "FlowFileRecord.h"
-#include "concurrentqueue.h"
-#include "core/Processor.h"
-#include "core/ProcessSession.h"
-#include <pugixml.hpp>
+#include <Windows.h>
 #include <winevt.h>
+
+#include <codecvt>

Review comment:
       thanks, fixed in [95aeacd](https://github.com/martinzink/nifi-minifi-cpp/commit/95aeacd78262361de87609058f1f208b01e4fe3b)

##########
File path: extensions/windows-event-log/CollectorInitiatedSubscription.cpp
##########
@@ -19,16 +19,17 @@
  */
 
 #include "CollectorInitiatedSubscription.h"
+#include <stdio.h>

Review comment:
       thanks, fixed in [95aeacd](https://github.com/martinzink/nifi-minifi-cpp/commit/95aeacd78262361de87609058f1f208b01e4fe3b)

##########
File path: extensions/windows-event-log/TailEventLog.cpp
##########
@@ -19,14 +19,16 @@
  */
 
 #include "TailEventLog.h"
+#include <stdio.h>

Review comment:
       thanks, fixed in [95aeacd](https://github.com/martinzink/nifi-minifi-cpp/commit/95aeacd78262361de87609058f1f208b01e4fe3b)

##########
File path: extensions/windows-event-log/TailEventLog.h
##########
@@ -120,10 +121,10 @@ class TailEventLog : public core::Processor {
       (LPTSTR)&lpMsg,
       0, NULL);
 
-    logger_->log_debug("Error %d: %s\n", (int)error_id, (char *)lpMsg);
+    logger_->log_debug("Error %d: %s\n", static_cast<int>(error_id), reinterpret_cast<char *>(lpMsg));

Review comment:
       thanks, fixed in [95aeacd](https://github.com/martinzink/nifi-minifi-cpp/commit/95aeacd78262361de87609058f1f208b01e4fe3b)

##########
File path: extensions/windows-event-log/TailEventLog.h
##########
@@ -120,10 +121,10 @@ class TailEventLog : public core::Processor {
       (LPTSTR)&lpMsg,
       0, NULL);
 
-    logger_->log_debug("Error %d: %s\n", (int)error_id, (char *)lpMsg);
+    logger_->log_debug("Error %d: %s\n", static_cast<int>(error_id), reinterpret_cast<char *>(lpMsg));

Review comment:
       good catch :) , fixed in [95aeacd](https://github.com/martinzink/nifi-minifi-cpp/commit/95aeacd78262361de87609058f1f208b01e4fe3b)

##########
File path: extensions/windows-event-log/tests/CWELTestUtils.h
##########
@@ -17,6 +17,10 @@
 
 #pragma once
 
+#include <utility>
+#include <memory>
+#include <string>

Review comment:
       thanks, fixed in [95aeacd](https://github.com/martinzink/nifi-minifi-cpp/commit/95aeacd78262361de87609058f1f208b01e4fe3b)

##########
File path: extensions/windows-event-log/wel/JSONUtils.h
##########
@@ -20,9 +20,10 @@
 #undef RAPIDJSON_ASSERT
 #define RAPIDJSON_ASSERT(x) if (!(x)) throw std::logic_error("rapidjson exception");  // NOLINT
 
-#include <pugixml.hpp>
-
 #include <stdexcept>  // for std::logic_error
+#include <string>

Review comment:
       thanks, fixed in [95aeacd](https://github.com/martinzink/nifi-minifi-cpp/commit/95aeacd78262361de87609058f1f208b01e4fe3b)

##########
File path: extensions/windows-event-log/wel/MetadataWalker.cpp
##########
@@ -17,9 +17,15 @@
  */
 
 #include <windows.h>
+#include <strsafe.h>
+
+#include <map>
+#include <string>
+#include <utility>
+#include <vector>

Review comment:
       thanks, fixed in [95aeacd](https://github.com/martinzink/nifi-minifi-cpp/commit/95aeacd78262361de87609058f1f208b01e4fe3b)

##########
File path: extensions/windows-event-log/wel/UnicodeConversion.h
##########
@@ -20,27 +20,27 @@
 
 #pragma once
 
-#include <string>
-
 #include <atlbase.h>
 #include <atlconv.h>
 
+#include <string>
+
 namespace org {
-  namespace apache {
-    namespace nifi {
-      namespace minifi {
-        namespace wel {
-          inline std::string to_string(const wchar_t* pChar) {
-            ATL::CW2A aString(pChar, CP_UTF8);
-            return std::string(aString);
-          }
+namespace apache {
+namespace nifi {
+namespace minifi {
+namespace wel {
+  inline std::string to_string(const wchar_t* pChar) {
+    ATL::CW2A aString(pChar, CP_UTF8);
+    return std::string(aString);
+  }
 
-          inline std::wstring to_wstring(const char* pChar) {
-            ATL::CA2W wString(pChar, CP_UTF8);
-            return std::wstring(wString);
-          }
-        } /* namespace wel */
-      } /* namespace minifi */
-    } /* namespace nifi */
-  } /* namespace apache */
+  inline std::wstring to_wstring(const char* pChar) {
+    ATL::CA2W wString(pChar, CP_UTF8);
+    return std::wstring(wString);
+  }

Review comment:
       thanks, fixed in [95aeacd](https://github.com/martinzink/nifi-minifi-cpp/commit/95aeacd78262361de87609058f1f208b01e4fe3b)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org