Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/v3.004-dev-cpp' into v3.008-dev-new
Browse files Browse the repository at this point in the history
* origin/v3.004-dev-cpp:
  Adds clang-format pre-commit hook
  Adds .clang-tidy
  • Loading branch information
kenorb committed May 4, 2024
2 parents fd565d1 + a8ddd3b commit 3b58324
Show file tree
Hide file tree
Showing 7 changed files with 125 additions and 12 deletions.
108 changes: 108 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
---
Checks: |-
*,
-altera-id-dependent-backward-branch,
-altera-struct-pack-align,
-altera-unroll-loops,
-bugprone-branch-clone,
-bugprone-copy-constructor-init,
-bugprone-easily-swappable-parameters,
-bugprone-integer-division,
-bugprone-macro-parentheses,
-bugprone-narrowing-conversions,
-bugprone-redundant-branch-condition,
-bugprone-reserved-identifier,
-bugprone-string-constructor,
-bugprone-unhandled-self-assignment,
-cert-dcl37-c,
-cert-dcl51-cpp,
-cert-msc30-c,
-cert-msc50-cpp,
-cert-oop54-cpp,
-cert-oop54-cpp,
-clang-diagnostic-error,
-concurrency-mt-unsafe,
-cppcoreguidelines-avoid-c-arrays,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-avoid-non-const-global-variables,
-cppcoreguidelines-c-copy-assignment-signature,
-cppcoreguidelines-init-variables,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-narrowing-conversions,
-cppcoreguidelines-non-private-member-variables-in-classes,
-cppcoreguidelines-owning-memory,
-cppcoreguidelines-prefer-member-initializer,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-type-member-init,
-cppcoreguidelines-pro-type-union-access,
-cppcoreguidelines-pro-type-vararg,
-cppcoreguidelines-special-member-functions,
-fuchsia-default-arguments-calls,
-fuchsia-default-arguments-declarations,
-fuchsia-overloaded-operator,
-fuchsia-trailing-return,
-google-explicit-constructor,
-google-global-names-in-headers,
-google-readability-braces-around-statements,
-google-readability-casting,
-google-runtime-int,
-hicpp-avoid-c-arrays,
-hicpp-braces-around-statements,
-hicpp-braces-around-statements,
-hicpp-exception-baseclass,
-hicpp-explicit-conversions,
-hicpp-member-init,
-hicpp-multiway-paths-covered,
-hicpp-named-parameter,
-hicpp-no-array-decay,
-hicpp-signed-bitwise,,
-hicpp-special-member-functions,
-hicpp-uppercase-literal-suffix,
-hicpp-use-auto,
-hicpp-use-equals-default,
-hicpp-use-nullptr,
-hicpp-vararg,
-llvm-else-after-return,
-llvm-header-guard,,
-llvmlibc-callee-namespace,
-llvmlibc-implementation-in-namespace,,
-llvmlibc-restrict-system-libc-headers,
-misc-definitions-in-headers,
-misc-no-recursion,
-misc-non-private-member-variables-in-classes,
-misc-non-private-member-variables-in-classes,
-misc-unconventional-assign-operator,
-misc-unused-parameters,,
-modernize-avoid-c-arrays,
-modernize-raw-string-literal,
-modernize-redundant-void-arg,
-modernize-use-auto,
-modernize-use-default-member-init,
-modernize-use-equals-default,
-modernize-use-nullptr,
-modernize-use-nullptr,
-modernize-use-trailing-return-type,
-modernize-use-using,
-performance-unnecessary-value-param,
-readability-avoid-const-params-in-decls,
-readability-braces-around-statements,
-readability-braces-around-statements,
-readability-const-return-type,
-readability-container-size-empty,
-readability-convert-member-functions-to-static,
-readability-delete-null-pointer,
-readability-else-after-return,
-readability-identifier-length,
-readability-implicit-bool-conversion,
-readability-isolate-declaration,
-readability-magic-numbers,
-readability-make-member-function-const,
-readability-named-parameter,
-readability-redundant-access-specifiers,
-readability-redundant-declaration,
-readability-redundant-string-init,
-readability-simplify-boolean-expr,
-readability-uppercase-literal-suffix,
FormatStyle: file
HeaderFilterRegex: '.*'
WarningsAsErrors: ''
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
exclude: '\.md$'
repos:

# - repo: https://github.com/pre-commit/mirrors-clang-format
# rev: v14.0.6
# hooks:
# - id: clang-format

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
Expand Down
13 changes: 5 additions & 8 deletions Instances.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,18 @@
#include "Dict.mqh"
#include "Util.h"

template<typename T>
template <typename T>
class Instances {
public:

public:
static T* instances[];
Instances(T* _self) {
Util::ArrayPush(instances, _self);
}
Instances(T* _self) { Util::ArrayPush(instances, _self); }

~Instances() {
//Util::ArrayRemove(instances, &this);
// Util::ArrayRemove(instances, &this);
}
};

template<typename T>
template <typename T>
T* Instances::instances[];

#endif // INSTANCES_MQH
2 changes: 1 addition & 1 deletion Task/tests/TaskGetter.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@
#include "../../Std.h"
#include "../../String.extern.h"

int main(int argc, char **argv) {}
int main(int argc, char **argv) { return 0; }
3 changes: 2 additions & 1 deletion Task/tests/TaskSetter.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@
*/

// Includes.
#include "../TaskSetter.h"

#include "../../Common.define.h"
#include "../../Common.extern.h"
#include "../../Std.h"
#include "../../String.extern.h"
#include "../TaskSetter.h"

int main(int argc, char **argv) {}
3 changes: 2 additions & 1 deletion Trade/tests/TradeSignal.test.cpp.fixme
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@
*/

// Includes.
#include "../TradeSignal.h"

#include "../../Common.define.h"
#include "../../Common.extern.h"
#include "../../Std.h"
#include "../../String.extern.h"
#include "../TradeSignal.h"

int main(int argc, char **argv) {}
3 changes: 2 additions & 1 deletion Trade/tests/TradeSignalManager.test.cpp.fixme
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@
*/

// Includes.
#include "../TradeSignalManager.h"

#include "../../Common.define.h"
#include "../../Common.extern.h"
#include "../../Std.h"
#include "../../String.extern.h"
#include "../TradeSignalManager.h"

int main(int argc, char **argv) {}

0 comments on commit 3b58324

Please sign in to comment.