Skip to content

Commit

Permalink
Codespell support (#317)
Browse files Browse the repository at this point in the history
* Pre-commit issues fixed

* Install codespell for pre-commit

* Address code spell issue throughout the code.

* Update archetype file names to correct spelling

* Add codespell config file

* Exclude dot directories

* Force CI build
  • Loading branch information
Twon authored Jun 29, 2024
1 parent b9cd166 commit 2a1beb5
Show file tree
Hide file tree
Showing 93 changed files with 315 additions and 308 deletions.
6 changes: 6 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# See: https://github.com/codespell-project/codespell#using-a-config-file
[codespell]
ignore-words-list = thirdparty,twon,wil
check-filenames =
check-hidden =
skip = ./.git,./conan2
1 change: 0 additions & 1 deletion .github/workflows/code_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,3 @@ jobs:
with:
working-directory: ${{github.workspace}}/build/${{env.BUILD_TYPE}}/coverage
files: ${{github.workspace}}/build/${{env.BUILD_TYPE}}/coverage/cobertura_coverage.xml

4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ repos:
- id: forbid-submodules
- id: requirements-txt-fixer
- id: trailing-whitespace
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ To set up Conan for the repository create a repository local virtual environment
cd <project root>
python3 -m venv .venv # Create a Python virtual env
source ./.venv/bin/activate # Activate the virtual env for bash by source.
pip install -r ./requirements.txt # Install all Python dependecies
pip install -r ./requirements.txt # Install all Python dependencies
conan profile detect --force # Generate a default configuration with the local machine settings
conan config install ./.conan # Install supported build profiles from ./.conan to ./conan2
```
Expand Down
2 changes: 1 addition & 1 deletion cmake/conformance.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function(morpheus_conformance_check)
message(FATAL_ERROR "RESULT parameter must be supplied")
endif()
if (NOT MORPHEUS_MSVC_VERSION AND NOT MORPHEUS_GNU_VERSION AND NOT MORPHEUS_CLANG_VERSION AND NOT MORPHEUS_APPLECLANG_VERSION)
message(FATAL_ERROR "Must check a minumum of one compiler version")
message(FATAL_ERROR "Must check a minimum of one compiler version")
endif()

list(APPEND SUPPORTED_COMPILERS "MSVC" "GNU" "Clang" "AppleClang")
Expand Down
4 changes: 2 additions & 2 deletions cmake/coverage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ function(enable_code_coverage)
WORKING_DIRECTORY
${CMAKE_BINARY_DIR}
COMMENT
"Distributed proccessing of coverage data collection and report generation"
"Distributed processing of coverage data collection and report generation"
)

add_custom_target(coverage)
Expand All @@ -243,7 +243,7 @@ function(enable_code_coverage)
WORKING_DIRECTORY
${CMAKE_BINARY_DIR}
COMMENT
"Distributed proccessing of coverage data collection and lcov report generation"
"Distributed processing of coverage data collection and lcov report generation"
)

add_custom_target(coverage-lcov-info
Expand Down
6 changes: 3 additions & 3 deletions cmake/morpheus_add_target.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ commonly associated attributes.
#]=======================================================================]
function(morpheus_add_target)
set(options INFERFACE)
set(options INTERFACE)
set(oneValueArgs TYPE NAME ALIAS FOLDER)
set(multiValueArgs)
cmake_parse_arguments(MORPHEUS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
Expand All @@ -77,8 +77,8 @@ function(morpheus_add_target)
if (NOT MORPHEUS_ALIAS AND MORPHEUS_TYPE STREQUAL library)
message(FATAL_ERROR "ALIAS parameter must be supplied for library targets")
endif()
if (NOT MORPHEUS_INFERFACE AND NOT MORPHEUS_TYPE STREQUAL library)
message(FATAL_ERROR "INFERFACE parameter can only be used with library targets")
if (NOT MORPHEUS_INTERFACE AND NOT MORPHEUS_TYPE STREQUAL library)
message(FATAL_ERROR "INTERFACE parameter can only be used with library targets")
endif()

if (MORPHEUS_TYPE STREQUAL executable)
Expand Down
4 changes: 2 additions & 2 deletions cmake/morpheus_add_testing_library.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ the installation process
#]=======================================================================]
function(morpheus_add_testing_library)
set(options INFERFACE)
set(options INTERFACE)
set(oneValueArgs NAME ALIAS FOLDER)
set(multiValueArgs)
cmake_parse_arguments(MORPHEUS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
Expand All @@ -63,7 +63,7 @@ function(morpheus_add_testing_library)
message(FATAL_ERROR "ALIAS parameter must be supplied")
endif()

if (NOT MORPHEUS_INFERFACE)
if (NOT MORPHEUS_INTERFACE)
add_library(${MORPHEUS_NAME})
target_link_libraries(${MORPHEUS_NAME}
PUBLIC
Expand Down
6 changes: 3 additions & 3 deletions cmake/targets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ function(targets_get_translation_units)

# CMAKE_CXX_SOURCE_FILE_EXTENSIONS defined in: https://github.com/Kitware/CMake/blob/master/Modules/CMakeCXXCompiler.cmake.in
foreach(cppExt IN LISTS CMAKE_CXX_SOURCE_FILE_EXTENSIONS)
# Filter on a copy of the oringal source list
# Filter on a copy of the original source list
set(filteredTargetSource "${targetSource}")
# Escape any file extensions with special characters (i.e. the '+' in "c++").
string(REGEX REPLACE "([][+.*()^])" "\\\\\\1" cppExt "${cppExt}")
Expand All @@ -139,8 +139,8 @@ function(targets_get_translation_units)

get_target_property(targetBinaryDir ${ARGS_TARGET} BINARY_DIR)
foreach(file IN LISTS targetTranslationUnits)
targets_relative_path_of_source(TARGET_NAME ${COVERAGE_TARGET_NAME} RESULT file SOURCE_FILE ${file})
set(translationUnitLocation "${targetBinaryDir}/CMakeFiles/${COVERAGE_TARGET_NAME}.dir/${file}")
targets_relative_path_of_source(TARGET_NAME ${ARGS_TARGET} RESULT file SOURCE_FILE ${file})
set(translationUnitLocation "${targetBinaryDir}/CMakeFiles/${ARGS_TARGET}.dir/${file}")
list(APPEND targetTranslationUnitLocations ${translationUnitLocation})
endforeach()

Expand Down
2 changes: 1 addition & 1 deletion cmake/warnings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ set(GCC_CLANG_COMPATIBLE_WARNINGS
-Wmissing-include-dirs # Warn if a user-supplied include directory does not exist.
-Wnull-dereference # Warn on null pointer dereference.
-Wpedantic # Standard conformance.
-Wshadow # Warning of a variabled shadows the declation of one from the parent context.
-Wshadow # Warning of a variabled shadows the declaration of one from the parent context.
)

set(GCC_WARNINGS
Expand Down
2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def build_requirements(self):
def requirements(self):
if self.options.get_safe("with_rs_vulkan", False):
self.requires("vulkan-headers/1.3.239.0")

if (self.settings.os in ["Macos", "iOS", "tvOS"]):
self.requires("moltenvk/1.2.2")

Expand Down
2 changes: 1 addition & 1 deletion docs/libraries/core/serialisation.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The serialisation framework provides concepts for readers and writers, which are
# Overview of serialisation in C++
- Killing C++ Serialization Overhead & Complexity - Eyal Zedaka - CppCon 2022: https://youtu.be/G7-GQhCw8eE

# Exisiting C++ Serialisation Libraries
# Existing C++ Serialisation Libraries
- Alpaca: https://github.com/p-ranav/alpaca
- Arvo: https://avro.apache.org/
- Bitsery: https://github.com/fraillt/bitsery
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void terminationHandler()
std::abort();
}

/// Standardises all application logs to common log name format of <progam name>-<process id>-<yeah-month-day>.log
/// Standardises all application logs to common log name format of <program name>-<process id>-<yeah-month-day>.log
/*std::string getDefaultApplicationLogName()
{
using namespace date_ns;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace morpheus::application
/// \class Application
/// The application class acts as a manager for a system of application components. It is responsible for walking
/// the application graph to initialised all components before entering the main loop. When walking the component
/// graph all commandline parameters will be collected and and sent for intialisation via input parameters.
/// graph all commandline parameters will be collected and and sent for initialisation via input parameters.
///
///
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
namespace boost
{

/// The default behavour for parsing of std::filesystem::path is fine except for the handling of spaces. However specialising
/// boost::lexical_cast for std::filesystem::path so strings are directly convertible to paths is enought to ensure correct
/// The default behaviour for parsing of std::filesystem::path is fine except for the handling of spaces. However specialising
/// boost::lexical_cast for std::filesystem::path so strings are directly convertible to paths is enough to ensure correct
/// handling of paths
/// @note
/// https://github.com/boostorg/program_options/issues/69
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace morpheus::application::po
{

/// \struct Config
/// Standard appication program options
/// Standard application program options
struct Config
{
bool loggingEnabled = true; ///< Logging is enabled.
Expand Down
6 changes: 3 additions & 3 deletions libraries/application/src/morpheus/application/po/options.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ concept CustomProgramOptions = requires(T& t, boost::program_options::options_de
// clang-format on

/// \struct HelpDocumentation
/// Holds commom help documentation information for applications.
/// Holds common help documentation information for applications.
struct HelpDocumentation
{
std::string_view name;
Expand Down Expand Up @@ -74,8 +74,8 @@ std::optional<int> parseProgramOptions(std::span<char const * const> parameters,

if (msgDetails.version && vm.count("version"))
{
auto const ouput = fmt_ns::format("{} {}", boost::dll::program_location().stem().string(), *msgDetails.version);
print_ns::print("{}", ouput);
auto const output = fmt_ns::format("{} {}", boost::dll::program_location().stem().string(), *msgDetails.version);
print_ns::print("{}", output);
return 1;
}

Expand Down
2 changes: 1 addition & 1 deletion libraries/application/tests/application.tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace morpheus::application::po
{

TEST_CASE_METHOD(LoggingFixture, "Ensure application parse common parameters", "[morpheus.application.application.paremeters]")
TEST_CASE_METHOD(LoggingFixture, "Ensure application parse common parameters", "[morpheus.application.application.parameters]")
{
GIVEN("A common application parameters")
{
Expand Down
2 changes: 1 addition & 1 deletion libraries/core/mocking/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
morpheus_add_testing_library(
INFERFACE
INTERFACE
NAME MorpheusCoreMocking
ALIAS morpheus::core::mocking
FOLDER "Libraries/Core"
Expand Down
14 changes: 7 additions & 7 deletions libraries/core/src/morpheus/core/base/assert_handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ namespace morpheus
{

/// \struct Assertion
/// Minium required information to report an assetion.
/// Minimum required information to report an assetion.
struct Assertion
{
sl_ns::source_location location; ///< The location of the assertion.
std::string_view expression; ///< The expression which resulted in the assertion.
std::string_view message; ///< Message with human readable decription of the assertion.
std::string_view message; ///< Message with human readable description of the assertion.
};

/// \using AssertHandler
Expand Down Expand Up @@ -49,16 +49,16 @@ MORPHEUSCORE_EXPORT AssertHaltHandler setAssertHaltHandler(AssertHaltHandler han
[[nodiscard]] MORPHEUSCORE_EXPORT AssertHaltHandler const& getAssertHaltHandler();

/// \enum AssertType
/// Defines the behavour type for assert handlers.
/// Defines the behaviour type for assert handlers.
enum class MORPHEUSCORE_EXPORT AssertType
{
Assert, ///< Assert behavour calls the handler and calls halt if the handler returns true.
Verify ///< Verify behavour calls the handler and unconditionally calls halt.
Assert, ///< Assert behaviour calls the handler and calls halt if the handler returns true.
Verify ///< Verify behaviour calls the handler and unconditionally calls halt.
};

/// Triggers the global assert handler.
/// \param[in] type The type of assert behavour.
/// \param[in] location The source file location where the assert orginated.
/// \param[in] type The type of assert behaviour.
/// \param[in] location The source file location where the assert originated.
/// \param[in] expr String representation of the condition.
/// \param[in] message An optional message describing the assert.
MORPHEUSCORE_EXPORT void assertHandler(AssertType type, sl_ns::source_location const location, std::string_view const expr,
Expand Down
2 changes: 1 addition & 1 deletion libraries/core/src/morpheus/core/base/compiler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
the code base.
\def MORPHEUS_COMP_VER
This token is used to numerate the version of the current current complier
This token is used to numerate the version of the current current compiler
(denoted by MORPHEUS_COMPILER)
*/
#if defined(__clang__)
Expand Down
2 changes: 1 addition & 1 deletion libraries/core/src/morpheus/core/base/debugging.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace morpheus
{
/// \def MORPHEUS_DEBUG_ENABLED
/// Test macro which is enabled by default for debug builds. This may be define by users when
/// it is known that debug behaviour is intended. Conversly it can be disabled by defining
/// it is known that debug behaviour is intended. Conversely it can be disabled by defining
/// MORPHEUS_DISABLE_DEBUG
/// \note
/// This can be manually disabled by defining MORPHEUS_DISABLE_DEBUG. This allows for removing
Expand Down
2 changes: 1 addition & 1 deletion libraries/core/src/morpheus/core/base/sanitizers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace mopheus
/// @}

/*! \def MORPHEUS_NO_SANITIZE_ADDRESS
Compiler agnostic abstraction of the attibute to eliminate address sanitizer from a method.
Compiler agnostic abstraction of the attribute to eliminate address sanitizer from a method.
*/
#if (MORPHEUS_IS_GCC_COMPATIBLE_COMPILER)
// https://clang.llvm.org/docs/AddressSanitizer.html#disabling-instrumentation-with-attribute-no-sanitize-address
Expand Down
2 changes: 1 addition & 1 deletion libraries/core/src/morpheus/core/conformance/version.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <morpheus/core/base/platform.hpp>

/// Ensure backware compatible support for __has_include
/// Ensure backward compatible support for __has_include
#ifndef __has_include
#define __has_include(x) 0
#endif
Expand Down
2 changes: 1 addition & 1 deletion libraries/core/src/morpheus/core/containers/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
add_subdirectory(concepts)
add_subdirectory(concepts)
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace morpheus::containers::concepts
/// <a href="https://eel.is/c++draft/container.requirements#associative.reqmts">[associative.reqmts]</a>, details at
/// <a href="https://en.cppreference.com/w/cpp/named_req/AssociativeContainer">AssociativeContainer</a>.
template <typename T>
concept Associative = AllocatorAware<T> && requires(T t, typename T::value_type v, typename T::key_type k, typename T::size_type s, typename T::iterator i,
concept Associative = AllocatorAware<T> && requires(T t, typename T::value_type v, typename T::key_type k, typename T::size_type s, typename T::iterator i,
typename T::const_iterator ci, typename T::key_compare c, typename T::node_type n,
std::initializer_list<typename T::value_type> il)
{
Expand All @@ -30,7 +30,7 @@ concept Associative = AllocatorAware<T> && requires(T t, typename T::value_type
{ T(il) };
{ t = il };
{ std::as_const(t).key_comp() } -> std::same_as<typename T::key_compare>;
{ std::as_const(t).value_comp() } -> std::same_as<typename T::value_compare>;
{ std::as_const(t).value_comp() } -> std::same_as<typename T::value_compare>;
{ t.emplace() } -> detail::InsertReturnType<T>;
{ t.emplace_hint(i) } -> std::same_as<typename T::iterator>;
{ t.insert(v) } -> detail::InsertReturnType<T>;
Expand All @@ -39,22 +39,22 @@ concept Associative = AllocatorAware<T> && requires(T t, typename T::value_type
#if (__cpp_lib_containers_ranges >= 202202L)
{ t.insert_range(ranges::subrange<typename T::iterator>{}) } -> std::same_as<void>;
#endif // (__cpp_lib_containers_ranges >= 202202L)
{ t.insert(il) } -> std::same_as<void>;
{ t.insert(il) } -> std::same_as<void>;
{ t.insert(std::move(n)) } -> detail::InsertNodeHandleReturnType<T>;
{ t.insert(ci, std::move(n)) } -> std::same_as<typename T::iterator>;
{ t.extract(k) } -> std::same_as<typename T::node_type>;
{ t.extract(ci) } -> std::same_as<typename T::node_type>;
{ t.merge(t) } -> std::same_as<void>;
{ t.erase(i) } -> std::same_as<typename T::iterator>;
{ t.erase(ci) } -> std::same_as<typename T::iterator>;
{ t.erase(i, i) } -> std::same_as<typename T::iterator>;
{ t.erase(ci, ci) } -> std::same_as<typename T::iterator>;
{ t.extract(k) } -> std::same_as<typename T::node_type>;
{ t.extract(ci) } -> std::same_as<typename T::node_type>;
{ t.merge(t) } -> std::same_as<void>;
{ t.erase(i) } -> std::same_as<typename T::iterator>;
{ t.erase(ci) } -> std::same_as<typename T::iterator>;
{ t.erase(i, i) } -> std::same_as<typename T::iterator>;
{ t.erase(ci, ci) } -> std::same_as<typename T::iterator>;
{ t.erase(k) } -> std::same_as<typename T::size_type>;
{ t.clear() } -> std::same_as<void>;
{ t.find(k) } -> std::same_as<typename T::iterator>;
{ std::as_const(t).find(k) } -> std::same_as<typename T::const_iterator>;
{ t.clear() } -> std::same_as<void>;
{ t.find(k) } -> std::same_as<typename T::iterator>;
{ std::as_const(t).find(k) } -> std::same_as<typename T::const_iterator>;
{ std::as_const(t).count(k) } -> std::same_as<typename T::size_type>;
{ std::as_const(t).contains(k) } -> std::same_as<bool>;
{ std::as_const(t).contains(k) } -> std::same_as<bool>;
{ t.lower_bound(k) } -> detail::BoundReturnType<T>;
{ std::as_const(t).lower_bound(k) } -> detail::BoundConstReturnType<T>;
{ t.equal_range(k) } -> detail::BoundReturnType<T>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ concept Container = requires(C c) {
{ empty(c) } -> std::same_as<bool>;
};

} // namespace morpheus::containers::concepts
} // namespace morpheus::containers::concepts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace morpheus::containers::concepts
template <typename T>
concept Contiguous = StrictSequence<T> && requires(T t){
requires std::contiguous_iterator<typename T::iterator>;
requires std::contiguous_iterator<typename T::const_iterator>;
requires std::contiguous_iterator<typename T::const_iterator>;
};

} // namespace morpheus::containers::concepts
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ concept BoundConstReturnType = requires
requires std::same_as<I, typename T::const_iterator> or std::same_as<I, std::pair<typename T::const_iterator, typename T::const_iterator>>;
};

} // namespace morpheus::containers::concepts
} // namespace morpheus::containers::concepts
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ concept Sequence = Container<T> && requires(T t, typename T::value_type v, typen
/// - std::string
/// - std::forward_list
/// - std::array
/// Hoever they are listed as as Sequence types while having interfaces that differ from the Sequence
/// However they are listed as as Sequence types while having interfaces that differ from the Sequence
/// container requirements so this extension concept exactly mirrors that requirement.
template <typename T>
concept StrictSequence = meta::is_array_v<T> ||
concept StrictSequence = meta::is_array_v<T> ||
meta::is_string_v<T> ||
std::same_as<T, std::forward_list<typename T::value_type>> ||
Sequence<T>;
Sequence<T>;


} // namespace morpheus::containers::concepts
Loading

0 comments on commit 2a1beb5

Please sign in to comment.