diff --git a/.clang-format b/.clang-format index 11d0dcd..e0958e5 100644 --- a/.clang-format +++ b/.clang-format @@ -1 +1,12 @@ BasedOnStyle: WebKit +QualifierAlignment: 'Custom' +QualifierOrder: [ + 'friend', + 'static', + 'constexpr', + 'inline', + 'volatile', + 'restrict', + 'const', + 'type', +] diff --git a/.clang-tidy b/.clang-tidy index dcb1de7..932a5be 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -56,6 +56,8 @@ CheckOptions: value: camelBack - key: readability-identifier-naming.GlobalFunctionCase value: camelBack + - key: readability-identifier-naming.GlobalFunctionIgnoredRegexp + value: '^TEST$' - key: readability-identifier-naming.GlobalPointerCase value: lower_case - key: readability-identifier-naming.GlobalVariableCase diff --git a/src/python_interpreter.cpp b/src/python_interpreter.cpp index c608f66..c71a642 100644 --- a/src/python_interpreter.cpp +++ b/src/python_interpreter.cpp @@ -67,11 +67,11 @@ PythonInterpreter::PythonInterpreter() // TODO: handle this failure return; } - PythonGuard const python_guard { state() }; + const PythonGuard python_guard { state() }; Py_DECREF(main_module); } } , state_ { nullptr, [](auto* state) { - PythonGuard const python_guard { state }; + const PythonGuard python_guard { state }; Py_EndInterpreter(state); } } { @@ -124,11 +124,11 @@ std::optional PythonInterpreter::load(const std::string& file_name) if (!file) { return LoadError::fileNotReadable; } - PythonGuard const python_guard { state() }; + const PythonGuard python_guard { state() }; auto* globals = PyModule_GetDict(mainModule()); assert(globals); auto* locals = globals; - int const start { Py_file_input }; + const int start { Py_file_input }; auto* result = PyRun_File(file.get(), file_name.c_str(), start, globals, locals); Py_DECREF(globals); if (result != nullptr) { diff --git a/test/.clang-tidy b/test/.clang-tidy index 164b9f3..b580f6f 100644 --- a/test/.clang-tidy +++ b/test/.clang-tidy @@ -10,4 +10,5 @@ Checks: > -bugprone-easily-swappable-parameters, -bugprone-unchecked-optional-access, -hicpp-noexcept-move, - -cppcoreguidelines-noexcept-move-operations + -cppcoreguidelines-noexcept-move-operations, + -cppcoreguidelines-init-variables