diff --git a/.clang-format b/.clang-format index fff9914..99f4b90 100644 --- a/.clang-format +++ b/.clang-format @@ -1,69 +1,8 @@ -AccessModifierOffset: -4 -AlignAfterOpenBracket: Align -AlignConsecutiveAssignments: true -AlignEscapedNewlinesLeft: false -AlignOperands: true -AlignTrailingComments: true -AllowAllParametersOfDeclarationOnNextLine: true -AllowShortBlocksOnASingleLine: true -AllowShortCaseLabelsOnASingleLine: true -AllowShortFunctionsOnASingleLine: Inline -AllowShortIfStatementsOnASingleLine: false -AllowShortLoopsOnASingleLine: false -AlwaysBreakAfterReturnType: None -AlwaysBreakBeforeMultilineStrings: false -AlwaysBreakTemplateDeclarations: true -BreakBeforeBraces: Custom -BraceWrapping: - AfterFunction: true - AfterClass: true - AfterControlStatement: true - AfterEnum: false - AfterNamespace: true - AfterStruct: true - AfterUnion: true - BeforeCatch: true - BeforeElse: true -BinPackArguments: true -BinPackParameters: true -BreakBeforeBinaryOperators: All -BreakBeforeTernaryOperators: true -BreakConstructorInitializersBeforeComma: true -BreakStringLiterals: true +IndentWidth: 2 +BasedOnStyle: 'google' ColumnLimit: 100 -CommentPragmas: '^ IWYU pragma:' -ConstructorInitializerAllOnOneLineOrOnePerLine: false -ConstructorInitializerIndentWidth: 4 -ContinuationIndentWidth: 4 -Cpp11BracedListStyle: true -DerivePointerAlignment: false -DisableFormat: false -ExperimentalAutoDetectBinPacking: false -IndentCaseLabels: true -IndentWidth: 4 -IndentWrappedFunctionNames: false -KeepEmptyLinesAtTheStartOfBlocks: false -MaxEmptyLinesToKeep: 4 -NamespaceIndentation: Inner -PenaltyBreakBeforeFirstCallParameter: 19 -PenaltyBreakComment: 300 -PenaltyBreakFirstLessLess: 120 -PenaltyBreakString: 1000 -PenaltyExcessCharacter: 1000000 -PenaltyReturnTypeOnItsOwnLine: 60 -PointerAlignment: Left -ReflowComments: true SortIncludes: false -SpaceAfterTemplateKeyword: false -SpaceBeforeAssignmentOperators: true -SpaceBeforeParens: ControlStatements -SpaceInEmptyParentheses: false -SpacesBeforeTrailingComments: 1 -SpacesInAngles: false -SpacesInCStyleCastParentheses: false -SpacesInContainerLiterals: false -SpacesInParentheses: false -SpacesInSquareBrackets: false -Standard: Cpp11 -TabWidth: 4 +QualifierAlignment: Right UseTab: Never +DerivePointerAlignment: false +PointerAlignment: Left diff --git a/.github/workflows/build_nix.yml b/.github/workflows/build_nix.yml index 17ea70c..84f50e3 100644 --- a/.github/workflows/build_nix.yml +++ b/.github/workflows/build_nix.yml @@ -16,8 +16,8 @@ jobs: - env: MKN_LIB_LINK_LIB: 1 - KUL_GIT_CO: --depth 1 + MKN_KUL_GIT_CO: --depth 1 run: | - curl -Lo mkn https://github.com/mkn/mkn/releases/download/latest/mkn_nix + curl -fL --retry 3 --retry-delay 2 -o mkn https://github.com/mkn/mkn/releases/download/latest/mkn_nix chmod +x mkn KLOG=2 ./mkn clean build run -dtOa "-std=c++17 -fPIC" diff --git a/.github/workflows/build_osx.yml b/.github/workflows/build_osx.yml index 0ffdf72..8021099 100644 --- a/.github/workflows/build_osx.yml +++ b/.github/workflows/build_osx.yml @@ -16,8 +16,8 @@ jobs: - env: MKN_LIB_LINK_LIB: 1 - KUL_GIT_CO: --depth 1 + MKN_KUL_GIT_CO: --depth 1 run: | - curl -Lo mkn https://github.com/mkn/mkn/releases/download/latest/mkn_arm_osx + curl -fL --retry 3 --retry-delay 2 -o mkn https://github.com/mkn/mkn/releases/download/latest/mkn_arm_osx chmod +x mkn KLOG=2 ./mkn clean build run -dtOa "-std=c++17 -fPIC" diff --git a/.github/workflows/build_win.yml b/.github/workflows/build_win.yml index 92866dc..84347fa 100644 --- a/.github/workflows/build_win.yml +++ b/.github/workflows/build_win.yml @@ -18,7 +18,7 @@ jobs: arch: amd64 - env: - KUL_GIT_CO: --depth 1 + MKN_KUL_GIT_CO: --depth 1 MKN_CL_PREFERRED: 1 shell: cmd run: | # /bin/link interferes with cl/link.exe diff --git a/mkn.yaml b/mkn.yaml index 5f026bc..f4c8351 100644 --- a/mkn.yaml +++ b/mkn.yaml @@ -14,7 +14,7 @@ profile: dep: mkn&${maiken_location}(${maiken_scm})[mod] if_arg: win_shared: -DYAML_CPP_DLL - shared: -DKUL_SHARED + shared: -DMKN_KUL_SHARED - name: test parent: base diff --git a/mod.cpp b/mod.cpp index 3781f74..ce3932a 100644 --- a/mod.cpp +++ b/mod.cpp @@ -45,20 +45,18 @@ class ModuleMaker : public maiken::Module { #endif bool pyconfig_found = 0; std::string HOME, PY = "python3", PYTHON, PY_CONFIG = "python-config", - PY3_CONFIG = "python3-config", - PATH = mkn::kul::env::GET("PATH"); + PY3_CONFIG = "python3-config", PATH = mkn::kul::env::GET("PATH"); mkn::kul::Dir bin; std::shared_ptr path_var; protected: - static void VALIDATE_NODE(YAML::Node const &node) { + static void VALIDATE_NODE(YAML::Node const& node) { using namespace mkn::kul::yaml; Validator({NodeValidator("args")}).validate(node); } public: - void init(maiken::Application &a, YAML::Node const & /*node*/) - KTHROW(std::exception) override { + void init(maiken::Application& a, YAML::Node const& /*node*/) KTHROW(std::exception) override { bool finally = 0; if (!kul::env::WHICH(PY.c_str())) PY = "python"; PYTHON = mkn::kul::env::GET("PYTHON"); @@ -77,8 +75,8 @@ class ModuleMaker : public maiken::Module { bin = mkn::kul::Dir("bin", HOME); if (!bin) KEXCEPT(kul::Exception, "$PYTHON3_HOME/bin does not exist"); #endif - path_var = std::make_shared( - "PATH", bin.real(), mkn::kul::cli::EnvVarMode::PREP); + path_var = + std::make_shared("PATH", bin.real(), mkn::kul::cli::EnvVarMode::PREP); mkn::kul::env::SET(path_var->name(), path_var->toString().c_str()); p.var(path_var->name(), path_var->toString()); }; @@ -100,9 +98,9 @@ class ModuleMaker : public maiken::Module { finally = 1; KEXCEPT(kul::Exception, "python-config does not exist on path"); } - } catch (const mkn::kul::Exception &e) { + } catch (mkn::kul::Exception const& e) { KERR << e.stack(); - } catch (const std::exception &e) { + } catch (std::exception const& e) { KERR << e.what(); } catch (...) { KERR << "UNKNOWN ERROR CAUGHT"; @@ -136,10 +134,8 @@ class ModuleMaker : public maiken::Module { } // namespace python3 } // namespace mkn -extern "C" KUL_PUBLISH maiken::Module *maiken_module_construct() { +extern "C" MKN_KUL_PUBLISH maiken::Module* maiken_module_construct() { return new mkn::python3::ModuleMaker; } -extern "C" KUL_PUBLISH void maiken_module_destruct(maiken::Module *p) { - delete p; -} +extern "C" MKN_KUL_PUBLISH void maiken_module_destruct(maiken::Module* p) { delete p; }