Skip to content

Commit

Permalink
Merge pull request #1035 from luszczewskakasia1/rst-scan
Browse files Browse the repository at this point in the history
RST scan
  • Loading branch information
lukaszstolarczuk authored Jan 15, 2025
2 parents 8e22b4c + f72a613 commit c2781ff
Show file tree
Hide file tree
Showing 11 changed files with 109 additions and 14 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/reusable_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ 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
run: |
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
Expand Down Expand Up @@ -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/'
2 changes: 1 addition & 1 deletion docs/config/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/config/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion docs/config/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion docs/config/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
74 changes: 74 additions & 0 deletions docs/config/spelling_exceptions.txt
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions include/umf/memory_pool.h
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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.
Expand Down
13 changes: 9 additions & 4 deletions include/umf/pools/pool_disjoint.h
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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,
Expand Down
8 changes: 5 additions & 3 deletions include/umf/providers/provider_os_memory.h
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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,

Expand Down
1 change: 1 addition & 0 deletions scripts/check_license/file-exceptions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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' \
Expand Down
3 changes: 3 additions & 0 deletions third_party/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit c2781ff

Please sign in to comment.