From 4ce0d1f8e2863a07b37168ac2b0d185bb922ba57 Mon Sep 17 00:00:00 2001 From: Nickolay Olshevsky Date: Wed, 18 Sep 2024 12:21:39 +0300 Subject: [PATCH 1/3] Fix typos and add typos check action. --- .github/workflows/lint.yml | 9 +++++++++ CMakeLists.txt | 2 +- README.adoc | 2 +- _typos.toml | 4 ++++ include/sexpp/sexp.h | 4 ++-- tests/scripts/tests.sh | 2 +- tests/src/exception-tests.cpp | 2 +- tests/src/primitives-tests.cpp | 2 +- 8 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 _typos.toml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 6703855..a0f81ed 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -54,3 +54,12 @@ jobs: steps: - uses: actions/checkout@v4 - uses: ludeeus/action-shellcheck@master + typos: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 1 + submodules: true + - uses: crate-ci/typos@master + \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index c768f78..fc1e3e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -250,7 +250,7 @@ if(WITH_SEXP_TESTS) set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) # do not install gtest set(INSTALL_GTEST OFF CACHE BOOL "" FORCE) - # explicitely disable unneeded gmock build + # explicitly disable unneeded gmock build set(BUILD_GMOCK OFF CACHE BOOL "" FORCE) FetchContent_MakeAvailable(googletest) diff --git a/README.adoc b/README.adoc index ff7a88f..c995c8b 100644 --- a/README.adoc +++ b/README.adoc @@ -20,7 +20,7 @@ Prof. Ronald Rivest and Prof. Butler Lampson of MIT LCS (now CSAIL). This library differs from the original C implementation in the following ways: -* It aims to be reuseable in C++ implementations and is importable via CMake. +* It aims to be reusable in C++ implementations and is importable via CMake. * It includes a test suite for correctness testing and tests against malformed S-Expressions. * It supports, and is tested against, all major platforms, including: diff --git a/_typos.toml b/_typos.toml new file mode 100644 index 0000000..d882c3c --- /dev/null +++ b/_typos.toml @@ -0,0 +1,4 @@ +[files] +extend-exclude = [ + "tests/abi/libsexpp.0.abi" +] \ No newline at end of file diff --git a/include/sexpp/sexp.h b/include/sexpp/sexp.h index 3ffb735..be9cf00 100644 --- a/include/sexpp/sexp.h +++ b/include/sexpp/sexp.h @@ -44,7 +44,7 @@ #include "sexp-public.h" #include "sexp-error.h" -// We are implementing char traits for octet_t with trhe following restrictions +// We are implementing char traits for octet_t with the following restrictions // -- limit visibility so that other traits for unsigned char are still possible // -- create template specializatio in std workspace (use workspace specialization // is not specified and causes issues at least with gcc 4.8 @@ -454,7 +454,7 @@ class SEXP_PUBLIC_SYMBOL sexp_output_stream_t : sexp_depth_manager { public: const uint32_t default_line_length = 75; enum sexp_print_mode { /* PRINTING MODES */ - canonical = 1, /* standard for hashing and tranmission */ + canonical = 1, /* standard for hashing and transmission */ base64 = 2, /* base64 version of canonical */ advanced = 3 /* pretty-printed */ }; diff --git a/tests/scripts/tests.sh b/tests/scripts/tests.sh index 4c37c78..e049d99 100755 --- a/tests/scripts/tests.sh +++ b/tests/scripts/tests.sh @@ -96,7 +96,7 @@ test_install_script() { # ...................................................................... # Check sexp client application -# THese are the examples from README.adoc +# These are the examples from README.adoc test_sexp_cli() { echo "==> SEXP client application test" diff --git a/tests/src/exception-tests.cpp b/tests/src/exception-tests.cpp index 3b5646b..93938d6 100644 --- a/tests/src/exception-tests.cpp +++ b/tests/src/exception-tests.cpp @@ -60,7 +60,7 @@ TEST_F(ExceptionTests, IllegalCharacter) "SEXP ERROR: illegal character '?' (0x3f) at position 16"); } -TEST_F(ExceptionTests, UnexpectedEofAfterQoute) +TEST_F(ExceptionTests, UnexpectedEofAfterQuote) { do_scan_with_exception("(\")\n", "SEXP ERROR: unexpected end of file at position 4"); } diff --git a/tests/src/primitives-tests.cpp b/tests/src/primitives-tests.cpp index 6c45484..24bfc46 100644 --- a/tests/src/primitives-tests.cpp +++ b/tests/src/primitives-tests.cpp @@ -110,7 +110,7 @@ TEST_F(PrimitivesTests, Base64Ofoctet_t) do_test_advanced("|YWJj|", "abc"); } -TEST_F(PrimitivesTests, Base64OfVerbatium) +TEST_F(PrimitivesTests, Base64OfVerbatim) { do_test_canonical("{MzphYmM=}", "3:abc"); do_test_advanced("{MzphYmM=}", "abc"); From bbaa70eb8adef257b4e8b0145c95694927ea9e03 Mon Sep 17 00:00:00 2001 From: Nickolay Olshevsky Date: Wed, 18 Sep 2024 12:39:12 +0300 Subject: [PATCH 2/3] Update clang-format version. --- .github/workflows/lint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a0f81ed..4e8add3 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -36,11 +36,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: DoozyX/clang-format-lint-action@v0.11 + - uses: DoozyX/clang-format-lint-action@v0.18.2 with: source: '.' extensions: 'h,cpp,c' - clangFormatVersion: 11 + clangFormatVersion: 11.0.0 # inplace: True # - uses: EndBug/add-and-commit@v9 # with: From 12acef567ad7f3134e4a3d46cc5dfc9798753a43 Mon Sep 17 00:00:00 2001 From: "Maxim [maxirmx] Samsonov" Date: Sun, 29 Sep 2024 00:17:19 +0300 Subject: [PATCH 3/3] Added empty lines at the end of files per POSIX spec --- .github/workflows/lint.yml | 1 - _typos.toml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4e8add3..ad3e6c7 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -62,4 +62,3 @@ jobs: fetch-depth: 1 submodules: true - uses: crate-ci/typos@master - \ No newline at end of file diff --git a/_typos.toml b/_typos.toml index d882c3c..3ee1ed2 100644 --- a/_typos.toml +++ b/_typos.toml @@ -1,4 +1,4 @@ [files] extend-exclude = [ "tests/abi/libsexpp.0.abi" -] \ No newline at end of file +]