Skip to content

Commit 5a5fbcb

Browse files
authored
refactor: rename project to Errors C++ (#53)
* build: move `error` package to the root directory * docs: adjust to only documenting `error` package * ci: build project from the root directory * build: rename CMake project and targets to `errors` * refactor: rename header includes to be prefixed with `errors` * docs: rename project URL to `threeal/errors-cpp`
1 parent 7f6e9db commit 5a5fbcb

File tree

15 files changed

+40
-141
lines changed

15 files changed

+40
-141
lines changed
File renamed without changes.
File renamed without changes.

.github/workflows/build.yml

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,91 +8,76 @@ on:
88
jobs:
99
debug:
1010
runs-on: ubuntu-latest
11-
strategy:
12-
matrix:
13-
package: [error]
1411
steps:
1512
- name: Checkout repository
1613
uses: actions/checkout@v4.1.1
1714

1815
- name: Configure CMake
1916
run: |
20-
cmake ${{ matrix.package }} \
21-
-B ${{ matrix.package }}/build \
17+
cmake . \
18+
-B build \
2219
-D BUILD_TESTING=ON \
2320
-D CHECK_FORMAT=ON \
2421
-D CHECK_WARNING=ON \
2522
-D CHECK_COVERAGE=ON
2623
2724
- name: Build project
28-
run: cmake --build ${{ matrix.package }}/build
25+
run: cmake --build build
2926

3027
- name: Run unit tests
31-
run: ctest --test-dir ${{ matrix.package }}/build --output-on-failure --no-tests=error
28+
run: ctest --test-dir build --output-on-failure --no-tests=error
3229

3330
- name: Check code coverage
3431
uses: threeal/gcovr-action@main
3532
with:
36-
root: ${{ matrix.package }}
3733
excludes: |
38-
${{ matrix.package }}/build/*
39-
${{ matrix.package }}/test/*
34+
build/*
35+
test/*
4036
fail-under-line: 100
4137

4238
- name: Check diff
4339
run: git diff --exit-code HEAD
4440

4541
debug-msvc:
4642
runs-on: windows-latest
47-
strategy:
48-
matrix:
49-
package: [error]
5043
steps:
5144
- name: Checkout repository
5245
uses: actions/checkout@v4.1.1
5346

5447
- name: Configure CMake
5548
run: |
56-
cmake ${{ matrix.package }} `
57-
-B ${{ matrix.package }}/build `
49+
cmake . `
50+
-B build `
5851
-D CMAKE_CXX_COMPILER=cl `
5952
-D BUILD_TESTING=ON `
6053
-D CHECK_WARNING=ON
6154
6255
- name: Build project
63-
run: cmake --build ${{ matrix.package }}/build
56+
run: cmake --build build
6457

6558
- name: Run unit tests
66-
run: ctest --test-dir ${{ matrix.package }}/build --output-on-failure --no-tests=error
59+
run: ctest --test-dir build --output-on-failure --no-tests=error
6760

6861
release:
6962
runs-on: ubuntu-latest
70-
strategy:
71-
matrix:
72-
package: [error]
7363
steps:
7464
- name: Checkout repository
7565
uses: actions/checkout@v4.1.1
7666

7767
- name: Configure and build project
7868
uses: threeal/cmake-action@v1.3.0
7969
with:
80-
source-dir: ${{ matrix.package }}
8170
run-build: true
8271

8372
release-msvc:
8473
runs-on: windows-latest
85-
strategy:
86-
matrix:
87-
package: [error]
8874
steps:
8975
- name: Checkout repository
9076
uses: actions/checkout@v4.1.1
9177

9278
- name: Configure and build project
9379
uses: threeal/cmake-action@v1.3.0
9480
with:
95-
source-dir: ${{ matrix.package }}
9681
cxx-compiler: cl
9782
run-build: true
9883

error/CMakeLists.txt renamed to CMakeLists.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
cmake_minimum_required(VERSION 3.0)
22

3-
project(error)
3+
project(errors)
44

55
# Import dependencies
66
include(cmake/CPM.cmake)
77
cpmaddpackage("gh:fmtlib/fmt#10.0.0")
88

99
# Build the main library
10-
add_library(error src/error.cpp)
11-
target_include_directories(error PUBLIC include)
12-
target_link_libraries(error PUBLIC fmt)
13-
target_compile_features(error PRIVATE cxx_std_20)
10+
add_library(errors src/error.cpp)
11+
target_include_directories(errors PUBLIC include)
12+
target_link_libraries(errors PUBLIC fmt)
13+
target_compile_features(errors PRIVATE cxx_std_20)
1414

1515
# Check if this project is the main project
1616
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
@@ -22,7 +22,7 @@ if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
2222
# Import Format.cmake to format source code
2323
if(CHECK_FORMAT)
2424
cpmaddpackage("gh:threeal/Format.cmake#auto-install-cmake-format")
25-
add_dependencies(error fix-format)
25+
add_dependencies(errors fix-format)
2626
endif()
2727

2828
if(BUILD_TESTING)
@@ -33,9 +33,9 @@ if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
3333
include("${Catch2_SOURCE_DIR}/extras/Catch.cmake")
3434

3535
# Build tests for the main library
36-
add_executable(error_test test/error_test.cpp)
37-
target_link_libraries(error_test PRIVATE error Catch2::Catch2WithMain)
38-
catch_discover_tests(error_test)
36+
add_executable(errors_test test/error_test.cpp)
37+
target_link_libraries(errors_test PRIVATE errors Catch2::Catch2WithMain)
38+
catch_discover_tests(errors_test)
3939
endif()
4040

4141
# Get all targets in this directory
@@ -61,6 +61,6 @@ if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
6161
# Build XML documentation
6262
if(BUILD_DOCS)
6363
include(cmake/add_xml_docs.cmake)
64-
add_xml_docs(docs include/error/error.hpp)
64+
add_xml_docs(docs include/errors/error.hpp)
6565
endif()
6666
endif()

README.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
# Overview
1+
# Error C++
22

3-
[![build status](https://img.shields.io/github/actions/workflow/status/threeal/cpp/build.yml?branch=main)](https://github.com/threeal/cpp/actions/workflows/build.yml)
4-
[![deploy status](https://img.shields.io/github/actions/workflow/status/threeal/cpp/deploy.yaml?branch=main&label=deploy)](https://github.com/threeal/cpp/actions/workflows/deploy.yaml)
3+
[![build status](https://img.shields.io/github/actions/workflow/status/threeal/errors-cpp/build.yml?branch=main)](https://github.com/threeal/errors-cpp/actions/workflows/build.yml)
4+
[![deploy status](https://img.shields.io/github/actions/workflow/status/threeal/errors-cpp/deploy.yaml?branch=main&label=deploy)](https://github.com/threeal/errors-cpp/actions/workflows/deploy.yaml)
55

6-
A comprehensive collection of [C++](https://isocpp.org/) utility packages.
7-
8-
## Packages
9-
10-
- [Error](./error) [WIP]: Provides utilities for error handling.
6+
A C++ package that provides utilities for error handling.
117

128
## License
139

File renamed without changes.
File renamed without changes.

docs/conf.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import os, subprocess
22

3-
project = 'cpp'
3+
project = 'Errors C++'
44
copyright = '2023, Alfi Maulana'
55
author = 'Alfi Maulana'
66

77
extensions = ['breathe']
88

9-
subprocess.call('cmake ../error -B ../error/build -D BUILD_DOCS=ON', shell=True)
10-
subprocess.call('cmake --build ../error/build --target docs', shell=True)
9+
subprocess.call('cmake .. -B ../build -D BUILD_DOCS=ON', shell=True)
10+
subprocess.call('cmake --build ../build --target docs', shell=True)
1111

12-
breathe_projects = {"error": "../error/build/docs"}
13-
breathe_default_project = "error"
12+
breathe_projects = {"errors": "../build/docs"}
13+
breathe_default_project = "errors"
1414

1515
html_theme = 'furo'
1616
html_static_path = ['_static']

docs/error/index.rst

Lines changed: 0 additions & 54 deletions
This file was deleted.

docs/index.rst

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
Overview
2-
========
1+
Errors C++
2+
=============
33

4-
A comprehensive collection of `C++`_ utility packages.
4+
A `C++`_ package that provides utilities for error handling.
55

66
.. _C++: https://isocpp.org
77

8-
Packages
8+
API Docs
99
--------
1010

11-
.. toctree::
12-
:maxdepth: 1
11+
.. doxygenfunction:: error::make
1312

14-
error/index.rst
13+
.. doxygenfunction:: error::format
14+
15+
.. doxygenstruct:: error::Error
16+
:members:
1517

1618
License
1719
-------

0 commit comments

Comments
 (0)