Skip to content

Commit

Permalink
First Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
szmyd committed Jul 31, 2024
0 parents commit 59b6f45
Show file tree
Hide file tree
Showing 20 changed files with 1,211 additions and 0 deletions.
146 changes: 146 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
---
# We'll use defaults from the LLVM style, but with 4 columns indentation.
BasedOnStyle: LLVM
IndentWidth: 4
---
Language: Cpp
# Force pointers to the type for C++.
DerivePointerAlignment: false
PointerAlignment: Left
ColumnLimit: 120

AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
AlignOperands: false
AlignTrailingComments: true
AllowShortIfStatementsOnASingleLine: true
AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: false
# AllowShortFunctionsOnASingleLine: InlineOnly
# AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakTemplateDeclarations: true

BinPackArguments: true
BinPackParameters: true
BreakConstructorInitializersBeforeComma: true
BreakConstructorInitializers: AfterColon

ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 8

IndentCaseLabels: false
SortIncludes: false
#IndentWrappedFunctionNames: true
#SpaceAfterTemplateKeyword: true
#SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpacesInAngles : true

---
Language: JavaScript
# Use 140 columns for JS.
ColumnLimit: 140
...


#####################
# ---
# Language: Cpp
# AccessModifierOffset: -1
# AlignAfterOpenBracket: Align
# AlignConsecutiveAssignments: false
# AlignConsecutiveDeclarations: false
# AlignEscapedNewlinesLeft: true
# AlignOperands: true
# AlignTrailingComments: true
# AllowAllParametersOfDeclarationOnNextLine: false
# AllowShortBlocksOnASingleLine: false
# AllowShortCaseLabelsOnASingleLine: false
# AllowShortFunctionsOnASingleLine: Inline
# AllowShortIfStatementsOnASingleLine: false
# AllowShortLoopsOnASingleLine: false
# AlwaysBreakAfterDefinitionReturnType: None
# AlwaysBreakAfterReturnType: None
# AlwaysBreakBeforeMultilineStrings: true
# AlwaysBreakTemplateDeclarations: true
# BinPackArguments: true
# BinPackParameters: false
# BraceWrapping:
# AfterClass: false
# AfterControlStatement: false
# AfterEnum: false
# AfterFunction: false
# AfterNamespace: false
# AfterObjCDeclaration: false
# AfterStruct: false
# AfterUnion: false
# BeforeCatch: false
# BeforeElse: false
# IndentBraces: false
# BreakBeforeBinaryOperators: None
# BreakBeforeBraces: Attach
# BreakBeforeInheritanceComma: false
# BreakBeforeTernaryOperators: true
# BreakAfterJavaFieldAnnotations: false
# BreakConstructorInitializersBeforeComma: false
# BreakStringLiterals: true
# ColumnLimit: 80
# CommentPragmas: '^ IWYU pragma:'
# ConstructorInitializerAllOnOneLineOrOnePerLine: true
# ConstructorInitializerIndentWidth: 4
# ContinuationIndentWidth: 4
# Cpp11BracedListStyle: true
# DerivePointerAlignment: false
# DisableFormat: false
# ExperimentalAutoDetectBinPacking: false
# FixNamespaceComments: true
# ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
# IncludeCategories:
# - Regex: '^<.*\.h>'
# Priority: 1
# - Regex: '^<.*'
# Priority: 2
# - Regex: '.*'
# Priority: 3
# IncludeIsMainRegex: '([-_](test|unittest))?$'
# IndentCaseLabels: true
# IndentWidth: 2
# IndentWrappedFunctionNames: false
# JavaScriptQuotes: Leave
# JavaScriptWrapImports: true
# KeepEmptyLinesAtTheStartOfBlocks: false
# MacroBlockBegin: ''
# MacroBlockEnd: ''
# MaxEmptyLinesToKeep: 1
# NamespaceIndentation: None
# ObjCBlockIndentWidth: 2
# ObjCSpaceAfterProperty: true
# ObjCSpaceBeforeProtocolList: false
# PenaltyBreakBeforeFirstCallParameter: 1
# PenaltyBreakComment: 300
# PenaltyBreakFirstLessLess: 120
# PenaltyBreakString: 1000
# PenaltyExcessCharacter: 1000000
# PenaltyReturnTypeOnItsOwnLine: 200
# PointerAlignment: Right
# ReflowComments: true
# SortIncludes: false
# SpaceAfterCStyleCast: false
# SpaceAfterTemplateKeyword: true
# SpaceBeforeAssignmentOperators: true
# SpaceBeforeParens: ControlStatements
# SpaceInEmptyParentheses: false
# SpacesBeforeTrailingComments: 2
# SpacesInAngles: false
# SpacesInContainerLiterals: true
# SpacesInCStyleCastParentheses: false
# SpacesInParentheses: false
# SpacesInSquareBrackets: false
# Standard: Auto
# TabWidth: 8
# UseTab: Never
# ...
41 changes: 41 additions & 0 deletions .github/workflows/conan_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: HomeBlocks Build

on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
Build:
strategy:
fail-fast: false
matrix:
platform: ["ubuntu-22.04"]
build-type: ["Debug", "Release"]
malloc-impl: ["libc", "tcmalloc"]
prerelease: ["True", "False"]
tooling: ["Sanitize", "Coverage", "None"]
exclude:
- build-type: Debug
prerelease: "False"
- build-type: Debug
tooling: None
- build-type: Debug
malloc-impl: tcmalloc
- build-type: Release
malloc-impl: libc
- build-type: Release
tooling: Sanitize
- build-type: Release
tooling: Coverage
uses: ./.github/workflows/build_commit.yml
with:
platform: ${{ matrix.platform }}
build-type: ${{ matrix.build-type }}
malloc-impl: ${{ matrix.malloc-impl }}
prerelease: ${{ matrix.prerelease }}
tooling: ${{ matrix.tooling }}
23 changes: 23 additions & 0 deletions .github/workflows/version_change_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Check Version Update

on:
pull_request:
types: [opened, edited, synchronize]

jobs:
check-file:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Check if file is modified
run: |
if git diff -r HEAD^1 HEAD -- conanfile.py | egrep "[ ]+version = "; then
echo "Version is updated with this PR, OK"
else
echo "Conan version is not updated with this PR. Please update that to allow PR merge"
exit 1
fi
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
*.pyc
.idea/**
.cache
.clangd

build
test_package/build
nosanitize/**

# Settings generated files and build files
generated/**
debug/**
release/**
cmake-*/**
nosanitize/**
build*
test_package/build*

# vscode
.vscode/**

# Visual Studio
CMakeSettings.json
CMakeUserPresets.json
.vs/**
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- Created repository

[Unreleased]: https://github.com/eBay/HomeBlocks/compare/...HEAD
40 changes: 40 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
cmake_minimum_required (VERSION 3.11)
project (homeobject LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 20)

if (NOT DEFINED CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE "Debug")
endif()

include (cmake/Flags.cmake)

enable_testing()
if ((DEFINED CODE_COVERAGE) AND (${CODE_COVERAGE}))
include (cmake/CodeCoverage.cmake)
APPEND_COVERAGE_COMPILER_FLAGS()
elseif ((DEFINED MEMORY_SANITIZER_ON) AND (${MEMORY_SANITIZER_ON}))
message(WARNING "********* Running with Memory Sanitizer *********")
add_flags("-fsanitize=address \
-fsanitize=undefined \
-fsanitize-address-use-after-scope \
-fno-sanitize=alignment \
-DCDS_ADDRESS_SANITIZER_ENABLED \
-fno-omit-frame-pointer \
-fno-optimize-sibling-calls "
)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address -fsanitize=undefined")
endif()
find_package(GTest QUIET REQUIRED)

find_program(CCACHE_FOUND ccache QUIET)
if (CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
endif ()

# add component version information
add_flags("-DPACKAGE_NAME=${PROJECT_NAME}")
add_flags("-DPACKAGE_VERSION=${PROJECT_VERSION}")

add_subdirectory(src)
Loading

0 comments on commit 59b6f45

Please sign in to comment.