From 42a95fd3ed047db4c38cd9a68d9a329d6b3c8dd1 Mon Sep 17 00:00:00 2001 From: Katarzyna Luszczewska Date: Mon, 13 Jan 2025 15:56:02 +0100 Subject: [PATCH 1/2] Fix spelling errors in a few files --- docs/config/api.rst | 2 +- docs/config/examples.rst | 2 +- include/umf/memory_pool.h | 4 ++-- include/umf/pools/pool_disjoint.h | 13 +++++++++---- include/umf/providers/provider_os_memory.h | 8 +++++--- 5 files changed, 18 insertions(+), 11 deletions(-) diff --git a/docs/config/api.rst b/docs/config/api.rst index 3eedc8f1d..1c20d709c 100644 --- a/docs/config/api.rst +++ b/docs/config/api.rst @@ -86,7 +86,7 @@ and operate on the provider. Fixed Memory Provider ------------------------------------------ -A memory provider that can provide memory from a given pre-allocated buffer. +A memory provider that can provide memory from a given preallocated buffer. .. doxygenfile:: provider_fixed_memory.h :sections: define enum typedef func var diff --git a/docs/config/examples.rst b/docs/config/examples.rst index c58e7fc22..4eeea6aa9 100644 --- a/docs/config/examples.rst +++ b/docs/config/examples.rst @@ -178,7 +178,7 @@ by a different library and the caller of the :any:`umfGetIPCHandle` function may The :any:`umfGetIPCHandle` function returns the IPC handle and its size. The IPC handle is a byte-copyable opaque data structure. The :any:`umf_ipc_handle_t` type is defined as a pointer to a byte array. The size of the handle might be different for different memory provider types. The code snippet below demonstrates how the IPC handle can -be serialized for marshalling purposes. +be serialized for marshaling purposes. .. code-block:: c diff --git a/include/umf/memory_pool.h b/include/umf/memory_pool.h index de045acf4..ae5e67a96 100644 --- a/include/umf/memory_pool.h +++ b/include/umf/memory_pool.h @@ -1,6 +1,6 @@ /* * - * Copyright (C) 2023-2024 Intel Corporation + * Copyright (C) 2023-2025 Intel Corporation * * Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception @@ -140,7 +140,7 @@ umf_result_t umfFree(void *ptr); /// * Implementations *must* store the error code in thread-local /// storage prior to returning NULL from the allocation functions. /// -/// * If the last allocation/de-allocation operation succeeded, the value returned by +/// * If the last allocation/deallocation operation succeeded, the value returned by /// this function is unspecified. /// /// * The application *may* call this function from simultaneous threads. diff --git a/include/umf/pools/pool_disjoint.h b/include/umf/pools/pool_disjoint.h index fdf682ae5..d268a1dac 100644 --- a/include/umf/pools/pool_disjoint.h +++ b/include/umf/pools/pool_disjoint.h @@ -1,6 +1,11 @@ -// Copyright (C) 2023-2024 Intel Corporation -// Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +/* + * + * Copyright (C) 2023-2025 Intel Corporation + * + * Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + * + */ #pragma once #ifdef __cplusplus @@ -87,7 +92,7 @@ umfDisjointPoolParamsSetTrace(umf_disjoint_pool_params_handle_t hParams, /// @brief Set shared limits for disjoint pool. /// @param hParams handle to the parameters of the disjoint pool. -/// @param hSharedLimits handle tp the shared limits. +/// @param hSharedLimits handle to the shared limits. /// @return UMF_RESULT_SUCCESS on success or appropriate error code on failure. umf_result_t umfDisjointPoolParamsSetSharedLimits( umf_disjoint_pool_params_handle_t hParams, diff --git a/include/umf/providers/provider_os_memory.h b/include/umf/providers/provider_os_memory.h index a6bf43a7d..90455cad1 100644 --- a/include/umf/providers/provider_os_memory.h +++ b/include/umf/providers/provider_os_memory.h @@ -1,9 +1,11 @@ /* - * Copyright (C) 2022-2024 Intel Corporation + * + * Copyright (C) 2022-2025 Intel Corporation * * Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -*/ + * + */ #ifndef UMF_OS_MEMORY_PROVIDER_H #define UMF_OS_MEMORY_PROVIDER_H @@ -23,7 +25,7 @@ extern "C" { /// Not every mode is supported on every system. typedef enum umf_numa_mode_t { /// Default binding mode. Actual binding policy is system-specific. On - /// linux this corresponds to MPOL_DEFAULT. If this mode is specified, + /// Linux this corresponds to MPOL_DEFAULT. If this mode is specified, /// nodemask must be NULL and maxnode must be 0. UMF_NUMA_MODE_DEFAULT, From f72a6130a52f459951768a12d6e1dc086d869bc2 Mon Sep 17 00:00:00 2001 From: Katarzyna Luszczewska Date: Mon, 13 Jan 2025 15:54:42 +0100 Subject: [PATCH 2/2] Add spelling check in the web docs --- .github/workflows/reusable_checks.yml | 9 ++- docs/config/Doxyfile | 2 +- docs/config/conf.py | 5 +- docs/config/spelling_exceptions.txt | 74 ++++++++++++++++++++++++ scripts/check_license/file-exceptions.sh | 1 + third_party/requirements.txt | 3 + 6 files changed, 91 insertions(+), 3 deletions(-) create mode 100644 docs/config/spelling_exceptions.txt diff --git a/.github/workflows/reusable_checks.yml b/.github/workflows/reusable_checks.yml index 6e700cec1..a7602d269 100644 --- a/.github/workflows/reusable_checks.yml +++ b/.github/workflows/reusable_checks.yml @@ -21,7 +21,7 @@ jobs: - name: Install dependencies run: | sudo apt-get update - sudo apt-get install -y black cmake clang-format-15 cmake-format libhwloc-dev + sudo apt-get install -y black cmake clang-format-15 cmake-format libhwloc-dev doxygen # Latest distros do not allow global pip installation - name: Install Python requirements in venv @@ -29,6 +29,7 @@ jobs: python3 -m venv .venv . .venv/bin/activate echo "$PATH" >> $GITHUB_PATH + python3 -m pip install -r third_party/requirements.txt python3 -m pip install bandit codespell - name: Configure CMake @@ -64,6 +65,12 @@ jobs: - name: Run codespell run: python3 ./.github/scripts/run-codespell.py + - name: Check spelling in docs + run: | + cmake -B build + cmake --build build --target docs + sphinx-build -b spelling ./build/docs_build/config ./build/docs_build/spelling_log -W + # Run Bandit recursively, but omit _deps directory (with 3rd party code) and python's venv - name: Run Bandit run: python3 -m bandit -r . -x '/_deps/,/.venv/' diff --git a/docs/config/Doxyfile b/docs/config/Doxyfile index f23117ff2..630946374 100644 --- a/docs/config/Doxyfile +++ b/docs/config/Doxyfile @@ -445,7 +445,7 @@ INLINE_SIMPLE_STRUCTS = NO # types are typedef'ed and only the typedef is referenced, never the tag name. # The default value is: NO. -TYPEDEF_HIDES_STRUCT = NO +TYPEDEF_HIDES_STRUCT = YES # The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This # cache is used to resolve symbols given their name and scope. Since this can be diff --git a/docs/config/conf.py b/docs/config/conf.py index fa4788ff4..ae698ba98 100644 --- a/docs/config/conf.py +++ b/docs/config/conf.py @@ -36,7 +36,10 @@ # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = ["breathe"] +extensions = ["breathe", "sphinxcontrib.spelling"] + +spelling_show_suggestions = True +spelling_word_list_filename = "spelling_exceptions.txt" # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. diff --git a/docs/config/spelling_exceptions.txt b/docs/config/spelling_exceptions.txt new file mode 100644 index 000000000..d4e40a3ec --- /dev/null +++ b/docs/config/spelling_exceptions.txt @@ -0,0 +1,74 @@ +addr +allocatable +allocator +allocators +calloc +CXL +copyable +customizable +daxX +deallocation +deallocating +deallocations +Devdax +dev +Globals +hMemtarget +hPool +hProvider +highPtr +io +interprocess +ipc +jemalloc +lowPtr +malloc +maxnode +mem +mempolicies +mempolicy +Mempolicy +memspace +Memspace +memspaces +Memtarget +memtarget +memtargets +middleware +multithreading +Nodemask +nodemask +numa +oneAPI +oneTBB +os +params +partList +pid +poolable +preallocated +providerIpcData +providential +ptr +realloc +Scalable +scalable +stdout +Tiering +tiering +topologies +umf +umfGetIPCHandle +umfMemoryProviderAlloc +umfMemoryProviderGetLastNativeError +umfMemoryProviderOpenIPCHandle +umfOsMemoryProviderParamsDestroy +umfPool +umfPoolCalloc +umfPoolDestroy +umfPoolGetTag +umfPoolMallocUsableSize +umfPoolRealloc +umfMemspaceUserFilter +umfMemspaceMemtargetAdd +unfreed \ No newline at end of file diff --git a/scripts/check_license/file-exceptions.sh b/scripts/check_license/file-exceptions.sh index 5a12443d9..10c556061 100755 --- a/scripts/check_license/file-exceptions.sh +++ b/scripts/check_license/file-exceptions.sh @@ -9,6 +9,7 @@ grep -v -E -e 'benchmark/ubench.h' \ -e 'ChangeLog' \ -e 'CODEOWNERS$' \ -e 'docs/assets/.*' \ + -e 'docs/config/spelling_exceptions.txt' \ -e 'docs/config/conf.py' \ -e 'docs/config/Doxyfile' \ -e 'include/umf/proxy_lib_new_delete.h' \ diff --git a/third_party/requirements.txt b/third_party/requirements.txt index 9832bf2f0..1255dcb92 100644 --- a/third_party/requirements.txt +++ b/third_party/requirements.txt @@ -15,3 +15,6 @@ sphinxcontrib_qthelp==2.0.0 breathe==4.35.0 sphinx==8.1.3 sphinx_book_theme==1.1.3 +# Spelling check in documentation +pyenchant==3.2.2 +sphinxcontrib-spelling==8.0.0