PyPartMC icon indicating copy to clipboard operation
PyPartMC copied to clipboard

fix C++ warnings

Open slayoo opened this issue 3 years ago • 9 comments

here's what is currently reported by the cpplint workflow:

CLANG WARNINGS:

/github/workspace/files/src%2Fpypartmc.cpp:7:10: error: 'pybind11/pybind11.h' file not found [clang-diagnostic-error]
#include "pybind11/pybind11.h"
         ^~~~~~~~~~~~~~~~~~~~~
/github/workspace/files/src%2Fpypartmc.cpp:22:9: warning: function-like macro 'STRINGIFY' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage]
#define STRINGIFY(x) #x
        ^
/github/workspace/files/src%2Fpypartmc.cpp:23:9: warning: function-like macro 'MACRO_STRINGIFY' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage]
#define MACRO_STRINGIFY(x) STRINGIFY(x)
        ^
/github/workspace/files/src%2Fpypartmc.cpp:27:1: warning: use a trailing return type for this function [modernize-use-trailing-return-type]
PYBIND11_MODULE(_PyPartMC, m) {
^
/github/workspace/files/src%2Fpypartmc.cpp:27:26: warning: all parameters should be named in a function [readability-named-parameter]
PYBIND11_MODULE(_PyPartMC, m) {
                         ^
                          /*unused*/  /*unused*/
/github/workspace/files/src%2Fpypartmc.cpp:182:10: warning: variable name 'si' is too short, expected at least 3 characters [readability-identifier-length]
    auto si = m.def_submodule("si", "SI units");
         ^

CPPCHECK WARNINGS:

CMakeLists.txt:143:45: error: syntax error [syntaxError]
foreach(target _PyPartMC)  # TODO: the same for partmclib
                                            ^
PyPartMC%2F__init__.py:5:1: error: syntax error: keyword 'if' is not allowed in global scope [syntaxError]
if (3, 8) <= sys.version_info and platform.system() == 'Windows':
^
clang-tidy-report.txt:14:31: error: Unmatched '{'. Configuration: ''. [syntaxError]
PYBIND11_MODULE(_PyPartMC, m) {
                              ^
setup.py:86:77: error: No pair for character ('). Can't process file. File is either invalid or unicode, which is currently not supported. [syntaxError]
            # Specify the arch if using MSVC generator, but only if it doesn't
                                                                            ^
src%2Fpypartmc.cpp:27:0: style: The function 'PYBIND11_MODULE' is never used. [unusedFunction]

^
nofile:0:0: information: Cppcheck cannot find all the include files (use --check-config for details) [missingInclude]

slayoo avatar Jun 19 '22 03:06 slayoo

Stale issue message

github-actions[bot] avatar Aug 18 '22 14:08 github-actions[bot]

Stale issue message

github-actions[bot] avatar Oct 17 '22 14:10 github-actions[bot]

Stale issue message

github-actions[bot] avatar Dec 18 '22 13:12 github-actions[bot]

Stale issue message

github-actions[bot] avatar Feb 17 '23 13:02 github-actions[bot]

Stale issue message

github-actions[bot] avatar Apr 22 '23 13:04 github-actions[bot]

Stale issue message

github-actions[bot] avatar Jun 22 '23 13:06 github-actions[bot]

Stale issue message

github-actions[bot] avatar Aug 23 '23 13:08 github-actions[bot]

Stale issue message

github-actions[bot] avatar Nov 06 '23 13:11 github-actions[bot]

Stale issue message

github-actions[bot] avatar Jan 22 '24 14:01 github-actions[bot]