Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 5 additions & 66 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions .github/workflows/build_nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 2 additions & 2 deletions .github/workflows/build_osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion .github/workflows/build_win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mkn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 9 additions & 13 deletions mod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<kul::cli::EnvVar> 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");
Expand All @@ -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<kul::cli::EnvVar>(
"PATH", bin.real(), mkn::kul::cli::EnvVarMode::PREP);
path_var =
std::make_shared<kul::cli::EnvVar>("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());
};
Expand All @@ -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";
Expand Down Expand Up @@ -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; }