From 14a90b67ddc4b040013e206686fad9e46c2157c3 Mon Sep 17 00:00:00 2001 From: yasahi-hpc <57478230+yasahi-hpc@users.noreply.github.com> Date: Tue, 18 Feb 2025 13:58:53 +0100 Subject: [PATCH] Add a spell check in CI (#227) * Add a spell check in CI * fix alignment in .typos.toml * fix indent for spell check * fix detected typos * exclude the word PNG * use png instead of PNG in Doxyfile.in --------- Co-authored-by: Yuuichi Asahi --- .github/workflows/build_test.yaml | 11 ++++++++++ .typos.toml | 10 +++++++++ README.md | 3 ++- common/unit_test/Test_Utils.cpp | 2 +- docs/Doxyfile.in | 2 +- docs/intro/using.rst | 2 +- examples/09_derivative/09_derivative.cpp | 2 +- fft/unit_test/Test_Transform.cpp | 26 ++++++++++++------------ 8 files changed, 40 insertions(+), 18 deletions(-) create mode 100644 .typos.toml diff --git a/.github/workflows/build_test.yaml b/.github/workflows/build_test.yaml index c78e4e40..61754f91 100644 --- a/.github/workflows/build_test.yaml +++ b/.github/workflows/build_test.yaml @@ -30,6 +30,17 @@ jobs: extensions: 'hpp,cpp' clangFormatVersion: 17 + # run typos for spell check + spell_check: + name: spell check with typos + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: crate-ci/typos@v1.29.7 + with: + files: ./cmake/ ./CMakeLists.txt ./docs/ ./README.md ./common/ ./fft/ ./examples/ ./install_test/ + config: ./.typos.toml + # check if Docker images should be recreated check_docker_files: uses: ./.github/workflows/__check_docker_files.yaml diff --git a/.typos.toml b/.typos.toml new file mode 100644 index 00000000..cb59cb95 --- /dev/null +++ b/.typos.toml @@ -0,0 +1,10 @@ +# SPDX-FileCopyrightText: (C) The kokkos-fft development team, see COPYRIGHT.md file +# +# SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception + +[default.extend-words] +# Don't correct these word (parts) +iy = "iy" +ND = "ND" +SAV = "SAV" +arange = "arange" diff --git a/README.md b/README.md index 2e63ea3e..ae6542e2 100644 --- a/README.md +++ b/README.md @@ -133,7 +133,8 @@ cmake --build build -j 8 ``` This way, all the functionalities are executed on A100 GPUs. For installation, details are provided in the [documentation](https://kokkosfft.readthedocs.io/en/latest/intro/building.html#install-kokkosfft-as-a-library). -## LICENCE +## LICENSE + [![License](https://img.shields.io/badge/License-Apache--2.0_WITH_LLVM--exception-blue)](https://spdx.org/licenses/LLVM-exception.html) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) diff --git a/common/unit_test/Test_Utils.cpp b/common/unit_test/Test_Utils.cpp index 829b5316..4554cef4 100644 --- a/common/unit_test/Test_Utils.cpp +++ b/common/unit_test/Test_Utils.cpp @@ -571,7 +571,7 @@ void test_are_pointers_aliasing() { using View2 = Kokkos::View; const int n1 = 10; - // sizeof ValeuType2 is larger or equal to ValueType1 + // sizeof ValueType2 is larger or equal to ValueType1 const int n2 = sizeof(ValueType1) == sizeof(ValueType2) ? n1 : n1 / 2 + 1; View1 view1("view1", n1); View2 view2("view2", n1); diff --git a/docs/Doxyfile.in b/docs/Doxyfile.in index 4269d405..a69b8edf 100644 --- a/docs/Doxyfile.in +++ b/docs/Doxyfile.in @@ -1564,7 +1564,7 @@ EXT_LINKS_IN_WINDOW = NO FORMULA_FONTSIZE = 10 # Use the FORMULA_TRANSPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are not +# generated for formulas are transparent pngs. Transparent pngs are not # supported properly for IE 6.0, but are supported on all modern browsers. # # Note that when changing this option you need to delete any form_*.png files in diff --git a/docs/intro/using.rst b/docs/intro/using.rst index b5721e57..763675a9 100644 --- a/docs/intro/using.rst +++ b/docs/intro/using.rst @@ -63,7 +63,7 @@ The following listing shows good and bad examples of Real FFTs. .. note:: - Input and ouptut views must have the same precision (either ``float`` or ``double``). + Input and output views must have the same precision (either ``float`` or ``double``). Supported data types -------------------- diff --git a/examples/09_derivative/09_derivative.cpp b/examples/09_derivative/09_derivative.cpp index def48200..fb5ad038 100644 --- a/examples/09_derivative/09_derivative.cpp +++ b/examples/09_derivative/09_derivative.cpp @@ -97,7 +97,7 @@ void initialize(RealView1DType& x, RealView1DType& y, ComplexView2DType& ikx, // // \param x [in]: 1D grid in x direction // \param y [in]: 1D grid in y direction -// \param dudxy [out]: 3D fiels of the analytical derivative values +// \param dudxy [out]: 3D field of the analytical derivative value template void analytical_solution(RealView1DType& x, RealView1DType& y, RealView3DType& dudxy) { diff --git a/fft/unit_test/Test_Transform.cpp b/fft/unit_test/Test_Transform.cpp index 4b03459d..95deea6d 100644 --- a/fft/unit_test/Test_Transform.cpp +++ b/fft/unit_test/Test_Transform.cpp @@ -506,7 +506,7 @@ void test_fft1_shape(T atol = 1.0e-12) { std::vector shapes = {n / 2, n, n * 2}; for (auto&& shape : shapes) { - // Real to comple + // Real to complex ComplexView1DType outr("outr", shape / 2 + 1), outr_b("outr_b", shape / 2 + 1), outr_o("outr_o", shape / 2 + 1), outr_f("outr_f", shape / 2 + 1); @@ -3206,10 +3206,10 @@ void test_fftn_3dfft_5dview(T atol = 1.e-12) { std::shuffle(std::begin(tmp_axes), std::end(tmp_axes), rng); // pickup 3 elements only - axes_type trimed_axes; + axes_type trimmed_axes; std::copy(std::begin(tmp_axes) + DIM - 3, std::end(tmp_axes), - std::begin(trimed_axes)); - list_of_tested_axes.push_back(trimed_axes); + std::begin(trimmed_axes)); + list_of_tested_axes.push_back(trimmed_axes); } for (auto& tested_axes : list_of_tested_axes) { @@ -3282,10 +3282,10 @@ void test_fftn_3dfft_6dview(T atol = 1.e-12) { std::shuffle(std::begin(tmp_axes), std::end(tmp_axes), rng); // pickup 3 elements only - axes_type trimed_axes; + axes_type trimmed_axes; std::copy(std::begin(tmp_axes) + DIM - 3, std::end(tmp_axes), - std::begin(trimed_axes)); - list_of_tested_axes.push_back(trimed_axes); + std::begin(trimmed_axes)); + list_of_tested_axes.push_back(trimmed_axes); } for (auto& tested_axes : list_of_tested_axes) { @@ -3358,10 +3358,10 @@ void test_fftn_3dfft_7dview(T atol = 1.e-12) { std::shuffle(std::begin(tmp_axes), std::end(tmp_axes), rng); // pickup 3 elements only - axes_type trimed_axes; + axes_type trimmed_axes; std::copy(std::begin(tmp_axes) + DIM - 3, std::end(tmp_axes), - std::begin(trimed_axes)); - list_of_tested_axes.push_back(trimed_axes); + std::begin(trimmed_axes)); + list_of_tested_axes.push_back(trimmed_axes); } for (auto& tested_axes : list_of_tested_axes) { @@ -3434,10 +3434,10 @@ void test_fftn_3dfft_8dview(T atol = 1.e-12) { std::shuffle(std::begin(tmp_axes), std::end(tmp_axes), rng); // pickup 3 elements only - axes_type trimed_axes; + axes_type trimmed_axes; std::copy(std::begin(tmp_axes) + DIM - 3, std::end(tmp_axes), - std::begin(trimed_axes)); - list_of_tested_axes.push_back(trimed_axes); + std::begin(trimmed_axes)); + list_of_tested_axes.push_back(trimmed_axes); } for (auto& tested_axes : list_of_tested_axes) {