Skip to content

Commit 5af820d

Browse files
authored
Merge pull request #1 from Ovum-Programming-Language/repo-setup
Set up the repository
2 parents eda7d52 + ab13611 commit 5af820d

39 files changed

+3048
-115
lines changed

.clang-format

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
Language: Cpp
3+
BasedOnStyle: Google
4+
AccessModifierOffset: -2
5+
AlignAfterOpenBracket: Align
6+
AlignConsecutiveAssignments: false
7+
AlignConsecutiveDeclarations: false
8+
AlignOperands: true
9+
AlignTrailingComments: true
10+
AllowShortBlocksOnASingleLine: Never
11+
AllowShortCaseLabelsOnASingleLine: false
12+
AllowShortFunctionsOnASingleLine: None
13+
AllowShortIfStatementsOnASingleLine: false
14+
AllowShortLoopsOnASingleLine: false
15+
AlwaysBreakAfterDefinitionReturnType: None
16+
AlwaysBreakAfterReturnType: None
17+
AlwaysBreakTemplateDeclarations: Yes
18+
BinPackArguments: false
19+
BinPackParameters: false
20+
BraceWrapping:
21+
AfterCaseLabel: false
22+
AfterClass: false
23+
AfterControlStatement: false
24+
AfterEnum: false
25+
AfterFunction: false
26+
AfterNamespace: false
27+
AfterStruct: false
28+
AfterUnion: false
29+
AfterExternBlock: false
30+
BeforeCatch: false
31+
BeforeElse: false
32+
BeforeLambdaBody: false
33+
BeforeWhile: false
34+
SplitEmptyFunction: false
35+
SplitEmptyRecord: false
36+
SplitEmptyNamespace: false
37+
AfterObjCDeclaration: false
38+
IndentBraces: false
39+
BreakBeforeBraces: Custom
40+
BreakBeforeTernaryOperators: true
41+
BreakConstructorInitializers: AfterColon
42+
BreakConstructorInitializersBeforeComma: false
43+
ColumnLimit: 120
44+
CompactNamespaces: false
45+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
46+
ContinuationIndentWidth: 4
47+
EmptyLineAfterAccessModifier: Never
48+
EmptyLineBeforeAccessModifier: LogicalBlock
49+
IncludeBlocks: Preserve
50+
IncludeCategories:
51+
- Regex: '^<.*'
52+
Priority: 1
53+
- Regex: '^".*'
54+
Priority: 2
55+
- Regex: '.*'
56+
Priority: 3
57+
IncludeIsMainRegex: ([-_](test|unittest))?$'([-_](test|unittest))?$'
58+
IndentCaseBlocks: false
59+
IndentCaseLabels: true
60+
IndentGotoLabels: true
61+
IndentPPDirectives: None
62+
IndentWidth: 2
63+
IndentWrappedFunctionNames: false
64+
InsertNewlineAtEOF: true
65+
MacroBlockBegin: ''
66+
MacroBlockEnd: ''
67+
MaxEmptyLinesToKeep: 1
68+
NamespaceIndentation: None
69+
PointerAlignment: Left
70+
SpaceAfterCStyleCast: true
71+
SpaceAfterLogicalNot: false
72+
SpaceAfterTemplateKeyword: false
73+
SpaceBeforeAssignmentOperators: true
74+
SpaceBeforeInheritanceColon: true
75+
SpaceBeforeParens: ControlStatements
76+
SpaceBeforeRangeBasedForLoopColon: true
77+
SpaceBeforeSquareBrackets: false
78+
SpaceInEmptyParentheses: false
79+
SpacesBeforeTrailingComments: 1
80+
SpacesInAngles: false
81+
SpacesInConditionalStatement: false
82+
SpacesInCStyleCastParentheses: false
83+
SpacesInParentheses: false
84+
SpacesInSquareBrackets: false
85+
TabWidth: 4
86+
UseTab: Never
87+
...

.clang-tidy

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Checks: '-*,
2+
modernize-*,
3+
performance-*,
4+
cppcoreguidelines-*,
5+
bugprone-*,
6+
-modernize-use-trailing-return-type,
7+
-performance-no-int-to-ptr,
8+
-cppcoreguidelines-avoid-const-or-ref-data-members,
9+
-cppcoreguidelines-pro-type-reinterpret-cast,
10+
-cppcoreguidelines-pro-type-union-access,
11+
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
12+
-bugprone-exception-escape,
13+
-bugprone-easily-swappable-parameters'
14+
15+
WarningsAsErrors: ''
16+
HeaderFilterRegex: ''
17+
FormatStyle: none
18+
CheckOptions:
19+
- key: modernize-use-using.IgnoreMacros
20+
value: 'true'

.github/workflows/ci_tests.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,23 @@ jobs:
1818
- name: Build main target
1919
shell: bash
2020
run: |
21-
cmake --build cmake-build-release --target cpp_tests || echo Built with errors
21+
cmake --build cmake-build-release || echo Built with errors
2222
2323
- name: Build tests target
2424
shell: bash
2525
run: |
26-
cmake --build cmake-build-debug --target cpp_tests_tests || echo Built with errors
26+
cmake --build cmake-build-debug --target ovum_tests || echo Built with errors
2727
2828
- name: Run program
2929
working-directory: .\cmake-build-release
3030
run: |
31-
.\cpp_tests.exe --help
31+
.\ovum.exe --help
3232
3333
- name: Run tests
3434
working-directory: .\cmake-build-debug
3535
run: |
3636
echo "Currently unable to run tests on Windows Latest MinGW. See https://gitmemories.com/cristianadam/HelloWorld/issues/12 and https://github.com/microsoft/vscode-cmake-tools/issues/2451"
37-
% .\cpp_tests_tests.exe
37+
% .\ovum_tests.exe
3838
3939
build-matrix:
4040
name: Tests and application run on ${{ matrix.config.name }}
@@ -72,33 +72,33 @@ jobs:
7272
- name: Build main target
7373
shell: bash
7474
run: |
75-
cmake --build cmake-build-release --target cpp_tests || echo "Built with errors"
75+
cmake --build cmake-build-release --target ovum || echo "Built with errors"
7676
7777
- name: Build tests target
7878
shell: bash
7979
run: |
80-
cmake --build cmake-build-debug --target cpp_tests_tests || echo "Built with errors"
80+
cmake --build cmake-build-debug --target ovum_tests || echo "Built with errors"
8181
8282
- name: Run program
8383
shell: bash
8484
working-directory: ./cmake-build-release
8585
run: |
8686
if [ "$RUNNER_OS" == "Windows" ]; then
87-
./cpp_tests.exe --help
87+
./ovum.exe --help
8888
else
8989
cd bin
90-
./cpp_tests --help
90+
./ovum --help
9191
fi
9292
9393
- name: Run tests
9494
shell: bash
9595
working-directory: ./cmake-build-debug
9696
run: |
9797
if [ "$RUNNER_OS" == "Windows" ]; then
98-
./cpp_tests_tests.exe
98+
./ovum_tests.exe
9999
else
100100
cd tests
101-
./cpp_tests_tests
101+
./ovum_tests
102102
fi
103103
104104
memory-leaks:
@@ -117,9 +117,9 @@ jobs:
117117
118118
- name: Build tests target
119119
run: |
120-
cmake --build cmake-build --target cpp_tests_tests
120+
cmake --build cmake-build --target ovum_tests
121121
122122
- name: Run valgrind
123123
working-directory: ./cmake-build/tests
124124
run: |
125-
valgrind --leak-check=full --track-origins=yes --error-exitcode=1 ./cpp_tests_tests
125+
valgrind --leak-check=full --track-origins=yes --error-exitcode=1 ./ovum_tests

.gitignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# CMake
22
**cmake-build*/
3+
build/
34

45
# All idea files
56
**.idea*/
@@ -10,6 +11,15 @@
1011
# IntelliJ
1112
**out/
1213

14+
# Visual Studio Code
15+
**.vscode/
16+
**.history/
17+
18+
# Clangd
19+
compile_commands.json
20+
compile_flags.txt
21+
.clangd
22+
1323
# mpeltonen/sbt-idea plugin
1424
**.idea_modules/
1525

@@ -22,6 +32,18 @@ crashlytics.properties
2232
crashlytics-build.properties
2333
fabric.properties
2434

35+
# Notepad++ temporary file
36+
*.bak
37+
38+
# API keys
39+
*.apikey
40+
41+
# Cache directories
42+
**cache*/
43+
44+
# Program settings files
45+
**.config*/compiler/*
46+
2547
# Prerequisites
2648
*.d
2749

CMakeLists.txt

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,14 @@
11
cmake_minimum_required(VERSION 3.12)
22

33
project(
4-
cpp_tests # Rename the project here and in ci_tests.yml
5-
VERSION 0.1
6-
DESCRIPTION "C++ Project with Google tests"
7-
LANGUAGES CXX
4+
ovum
5+
VERSION 0.1
6+
DESCRIPTION "Ovum programming language toolset"
7+
LANGUAGES CXX
88
)
99

10-
set(CMAKE_CXX_STANDARD 20)
11-
12-
if (WIN32) # Install dlls in the same directory as the executable on Windows
13-
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR})
14-
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR})
15-
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR})
16-
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR})
17-
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR})
18-
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR})
19-
endif ()
20-
21-
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
22-
set(CMAKE_CXX_FLAGS_DEBUG "/MDd")
23-
set(CMAKE_CXX_FLAGS_RELEASE "/O2")
24-
else ()
25-
set(CMAKE_CXX_FLAGS_DEBUG "-g")
26-
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
27-
endif ()
10+
include(cmake/SetCompilerOptions.cmake)
11+
include(cmake/IncludeExternalLibraries.cmake)
2812

2913
add_subdirectory(lib)
3014
add_subdirectory(bin)

CODEBASE_STRUCTURE.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Base Repository Structure
2+
3+
## Directory Purposes
4+
5+
### Root Directory
6+
- **Project documentation** — README, build instructions, developer guides
7+
- **Build configuration**`CMakeLists.txt`, auxiliary CMake scripts
8+
- **Tooling settings** — configurations for formatting, linters, Git
9+
- **Automation scripts** — dependency installation, environment setup
10+
11+
### `bin/`
12+
- **Executables** — application entry point
13+
- **CLI interface** — command line for user interaction
14+
15+
### `docs/`
16+
- **Project documentation** — README, build instructions, developer guides
17+
18+
### `lib/`
19+
- **Core library** — the project's core functionality
20+
- **UI module** — user interface and CLI utilities
21+
- **Shared components** — reusable code parts. Add new modules only under this directory.
22+
23+
### `tests/`
24+
- **Unit tests** — testing individual components
25+
- **Integration tests** — testing interactions between modules
26+
- **Helper functions** — utilities for testing
27+
- **Test data** — examples and fixtures for tests
28+
29+
### `.github/workflows/`
30+
- **CI/CD configuration** — automated build and testing
31+
- **Code quality checks** — static analysis, formatting
32+
- **Deployment** — automated release publishing

CODE_OF_CONDUCT.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at [bigulov.sasha@gmail.com](mailto:bigulov.sasha@gmail.com). All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

0 commit comments

Comments
 (0)