-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(random): Implement templated random number generation and remove…
… move semantics
- Loading branch information
Showing
12 changed files
with
367 additions
and
286 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,103 +1,90 @@ | ||
Checks: > | ||
*, | ||
-altera-id-dependent-backward-branch, | ||
-altera-struct-pack-align, | ||
-altera-unroll-loops, | ||
-fuchsia-*, | ||
-llvmlibc-*, | ||
-llvm-header-guard, | ||
-llvm-include-order, | ||
-cppcoreguidelines-owning-memory, | ||
-cppcoreguidelines-non-private-member-variables-in-classes, | ||
-cppcoreguidelines-avoid-non-const-global-variables, | ||
-cppcoreguidelines-avoid-magic-numbers, | ||
-google-readability-todo, | ||
-modernize-use-trailing-return-type, | ||
-modernize-pass-by-value, | ||
-misc-non-private-member-variables-in-classes, | ||
-performance-avoid-endl, | ||
-*, | ||
bugprone-*, # Enable bug-prone checks | ||
cppcoreguidelines-*, # Enable C++ Core Guidelines checks | ||
modernize-*, # Enable modernization checks | ||
readability-*, # Enable readability checks | ||
performance-* # Enable performance checks | ||
# Checks: > | ||
# *, | ||
# -cppcoreguidelines-owning-memory | ||
# -google-readability-todo, | ||
# -altera-unroll-loops, | ||
# -altera-id-dependent-backward-branch, | ||
# -altera-struct-pack-align, | ||
# -fuchsia-*, | ||
# fuchsia-multiple-inheritance, | ||
# -llvm-header-guard, | ||
# -llvm-include-order, | ||
# -llvmlibc-*, | ||
# -modernize-use-trailing-return-type, | ||
# -misc-non-private-member-variables-in-classes, | ||
# -cppcoreguidelines-pro-type-vararg, | ||
# -cppcoreguidelines-avoid-c-arrays, | ||
# -hicpp-vararg, | ||
# -hicpp-avoid-c-arrays, | ||
# -modernize-avoid-c-arrays | ||
# Optionally, disable specific checks that are not relevant | ||
# For example, if you don't use certain C++ features or have specific project constraints | ||
# -*.fuchsia-* | ||
# -*.llvmlibc-* | ||
# -*.llvm-* | ||
|
||
WarningsAsErrors: "" | ||
# WarningsAsErrors: "*,-readability-convert-member-functions-to-static" | ||
WarningsAsErrors: "*" | ||
|
||
CheckOptions: | ||
- key: "readability-identifier-length.MinimumVariableNameLength" | ||
# Identifier Length | ||
- key: readability-identifier-length.MinimumVariableNameLength | ||
value: "2" | ||
- key: "readability-identifier-length.MinimumParameterNameLength" | ||
- key: readability-identifier-length.MinimumParameterNameLength | ||
value: "2" | ||
- key: "readability-identifier-length.MinimumLoopCounterNameLength" | ||
- key: readability-identifier-length.MinimumLoopCounterNameLength | ||
value: "2" | ||
- { key: readability-identifier-naming.NamespaceCase, value: lower_case } | ||
|
||
# Naming Conventions | ||
# Namespaces | ||
- { key: readability-identifier-naming.NamespaceCase, value: snake_case } | ||
|
||
# Macros | ||
- { | ||
key: readability-identifier-naming.MacroDefinitionCase, | ||
value: UPPER_CASE, | ||
} | ||
|
||
# Types | ||
- { key: readability-identifier-naming.ClassCase, value: CamelCase } | ||
- { key: readability-identifier-naming.StructCase, value: CamelCase } | ||
- { key: readability-identifier-naming.EnumCase, value: CamelCase } | ||
- { key: readability-identifier-naming.EnumConstantCase, value: CamelCase } | ||
- { key: readability-identifier-naming.EnumConstantCase, value: UPPER_CASE } | ||
- { key: readability-identifier-naming.TypedefCase, value: CamelCase } | ||
- { key: readability-identifier-naming.TypeAliasCase, value: CamelCase } | ||
- { key: readability-identifier-naming.UnionCase, value: CamelCase } | ||
|
||
- { key: readability-identifier-naming.FunctionCase, value: lower_case } | ||
- { key: readability-identifier-naming.GlobalFunctionCase, value: lower_case } | ||
# Functions | ||
- { key: readability-identifier-naming.FunctionCase, value: snake_case } | ||
- { key: readability-identifier-naming.GlobalFunctionCase, value: snake_case } | ||
|
||
- { key: readability-identifier-naming.GlobalVariableCase, value: CamelCase } | ||
# Variables | ||
- { key: readability-identifier-naming.GlobalVariableCase, value: snake_case } | ||
- { key: readability-identifier-naming.LocalVariableCase, value: snake_case } | ||
- { key: readability-identifier-naming.ParameterCase, value: snake_case } | ||
|
||
- { key: readability-identifier-naming.LocalVariableCase, value: aNy_CasE } | ||
- { key: readability-identifier-naming.ParameterCase, value: aNy_CasE } | ||
#static | ||
- { key: readability-identifier-naming.ClassMemberCase, value: lower_case } | ||
- { key: readability-identifier-naming.ClassMethodCase, value: lower_case } | ||
# Class Members and Methods | ||
- { key: readability-identifier-naming.ClassMemberCase, value: snake_case_ } | ||
- { key: readability-identifier-naming.ClassMethodCase, value: snake_case } | ||
|
||
- { key: readability-identifier-naming.MethodCase, value: lower_case } | ||
- { key: readability-identifier-naming.PrivateMethodCase, value: lower_case } | ||
# General Methods | ||
- { key: readability-identifier-naming.MethodCase, value: snake_case } | ||
- { key: readability-identifier-naming.PrivateMethodCase, value: snake_case } | ||
|
||
- { key: readability-identifier-naming.MemberCase, value: lower_case } | ||
- { key: readability-identifier-naming.PrivateMemberCase, value: lower_case } | ||
# Members | ||
- { key: readability-identifier-naming.MemberCase, value: snake_case_ } | ||
- { key: readability-identifier-naming.PrivateMemberCase, value: snake_case_ } | ||
- { key: readability-identifier-naming.PrivateMemberSuffix, value: "_" } | ||
|
||
- { key: readability-identifier-naming.VariableCase, value: lower_case } | ||
|
||
- { key: readability-identifier-naming.StaticVariableCase, value: lower_case } | ||
# Variables | ||
- { key: readability-identifier-naming.VariableCase, value: snake_case } | ||
- { key: readability-identifier-naming.StaticVariableCase, value: snake_case } | ||
- { | ||
key: readability-identifier-naming.ConstexprVariableCase, | ||
value: UPPER_CASE, | ||
} | ||
#constant | ||
- { key: readability-identifier-naming.GlobalConstantCase, value: lower_case } | ||
|
||
- { key: readability-identifier-naming.MemberConstantCase, value: lower_case } | ||
|
||
- { key: readability-identifier-naming.StaticConstantCase, value: lower_case } | ||
# Constants | ||
- { key: readability-identifier-naming.GlobalConstantCase, value: UPPER_CASE } | ||
- { key: readability-identifier-naming.MemberConstantCase, value: UPPER_CASE } | ||
- { key: readability-identifier-naming.StaticConstantCase, value: UPPER_CASE } | ||
|
||
# Template Parameters | ||
- { | ||
key: readability-identifier-naming.TemplateParameterCase, | ||
value: CamelCase, | ||
} | ||
# some magic number | ||
|
||
# Magic Numbers | ||
- { | ||
key: readability-magic-numbers.IgnoredIntegerValues, | ||
value: "-1; 0; 1; 2; 3; 4; 5;10;100", | ||
} | ||
value: "-1;0;1;2;3;4;5;10;100", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: C++ CI | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build-and-test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y cmake g++ make | ||
- name: Build | ||
run: | | ||
mkdir build && cd build | ||
cmake .. | ||
make | ||
- name: Run tests | ||
run: | | ||
cd build | ||
ctest --output-on-failure | ||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install clang-format | ||
run: sudo apt-get install -y clang-format | ||
|
||
- name: Run clang-format | ||
run: | | ||
find src tests -name '*.cpp' -o -name '*.h' | xargs clang-format -i --style=file | ||
git diff --exit-code | ||
clang-tidy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y cmake g++ make clang-tidy | ||
- name: Generate compile_commands.json | ||
run: | | ||
mkdir build && cd build | ||
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .. | ||
- name: Run clang-tidy | ||
run: | | ||
find src tests -name '*.cpp' -o -name '*.h' | xargs clang-tidy -p build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
# Random class | ||
|
||
- [] Review all the unit tests | ||
- [ ] Random unit tests | ||
|
||
# Project wide | ||
|
||
- add gcov | ||
- add CI/Coverage | ||
- [ ] add gcov | ||
- [ ] add CI/Coverage | ||
- [ ] choose a logging library |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.