Skip to content

Commit

Permalink
refactor: Fix clang-tidy warnings in ir_native.cpp. (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
LinZhihao-723 authored Dec 7, 2024
1 parent b1cbedb commit b15c040
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions lint-tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ tasks:
- "{{.CLP_FFI_PY_CPP_SRC_DIR}}/api_decoration.hpp"
- "{{.CLP_FFI_PY_CPP_SRC_DIR}}/error_messages.hpp"
- "{{.CLP_FFI_PY_CPP_SRC_DIR}}/ExceptionFFI.hpp"
- "{{.CLP_FFI_PY_CPP_SRC_DIR}}/modules"
- "{{.CLP_FFI_PY_CPP_SRC_DIR}}/Py_utils.cpp"
- "{{.CLP_FFI_PY_CPP_SRC_DIR}}/Py_utils.hpp"
- "{{.CLP_FFI_PY_CPP_SRC_DIR}}/PyExceptionContext.hpp"
Expand Down
7 changes: 5 additions & 2 deletions src/clp_ffi_py/modules/ir_native.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ PyDoc_STRVAR(
"Python interface to the CLP IR serialization and deserialization methods."
);

// NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays)
// NOLINTBEGIN(cppcoreguidelines-avoid-non-const-global-variables)
// NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays, modernize-avoid-c-arrays)
PyMethodDef Py_native_method_table[]{{nullptr, nullptr, 0, nullptr}};

PyModuleDef Py_native{
Expand All @@ -28,9 +29,11 @@ PyModuleDef Py_native{
-1,
static_cast<PyMethodDef*>(Py_native_method_table)
};

// NOLINTEND(cppcoreguidelines-avoid-non-const-global-variables)
} // namespace

// NOLINTNEXTLINE(modernize-use-trailing-return-type)
// NOLINTNEXTLINE(modernize-use-trailing-return-type, readability-identifier-naming)
PyMODINIT_FUNC PyInit_native() {
PyObject* new_module{PyModule_Create(&Py_native)};
if (nullptr == new_module) {
Expand Down
1 change: 1 addition & 0 deletions src/wrapped_facade_headers/Python.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <memoryobject.h>
#include <methodobject.h>
#include <modsupport.h>
#include <moduleobject.h>
#include <object.h>
#include <objimpl.h>
#include <pyerrors.h>
Expand Down

0 comments on commit b15c040

Please sign in to comment.