From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 874386750F8; Mon, 23 Oct 2023 15:29:35 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 874386750F8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1698064175; bh=v4PMQoSmceDHnkPqNEYGg2N2fYqYErll2pXhz7I+K5I=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=dP4j6iCf9+gCFh1TcsH1tHyhaFykzhgMAkJ5QbdrED7MEzCT9rveWODpd2xwyNaq8 VD0s5zdAgO8Si6RkJIM89tucNjp+6X8CrRiiRhoMwE+qHzKn/VnwJtnX/Y9wV7k+Wu 0mk6lp3SOOX9+ysnJEyWyKgkO7HZc33f4DLy7sfk= Received: from smtp43.i.mail.ru (smtp43.i.mail.ru [95.163.41.66]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 3EB28674153 for ; Mon, 23 Oct 2023 15:29:34 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 3EB28674153 Received: by smtp43.i.mail.ru with esmtpa (envelope-from ) id 1quu3p-00DBHr-1A; Mon, 23 Oct 2023 15:29:33 +0300 Message-ID: <4b791cd8-0174-4cff-9c4d-7faa5eff8550@tarantool.org> Date: Mon, 23 Oct 2023 15:29:32 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Sergey Kaplun , Sergey Bronnikov Cc: tarantool-patches@dev.tarantool.org, max.kokryashkin@gmail.com References: <0f1c6ed9f0bdade86631edc135839e607f3bb7f6.1697042800.git.sergeyb@tarantool.org> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9C197A170B57C5E43424B4CF9DFD4ED6F3F9F04D90C6DD02600894C459B0CD1B92D64B729F9403A87AF66FCB1157F241BFCAA5EF2E76CE6DDAFE7A561BD4DB76D X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE75644E22E05AA81AEB287FD4696A6DC2FA8DF7F3B2552694A4E2F5AFA99E116B42401471946AA11AFEE3A9D0FB4FE0F9986614E11AFA257BF8F08D7030A58E5AD1A62830130A00468AEEEE3FBA3A834EE7353EFBB55337566F4AE8016BBA3C0E9D054D196CBF5A405A4EFD8F948AA978CA471835C12D1D9774AD6D5ED66289B5278DA827A17800CE7850F8B975A76562C9FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C353FA85A707D24CADCC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB8D32BA5DBAC0009BE9E8FC8737B5C22495CCB7B391645D56A76E601842F6C81A12EF20D2F80756B5FB606B96278B59C4276E601842F6C81A127C277FBC8AE2E8BA5BFDC4EE84C98CD3AA81AA40904B5D99C9F4D5AE37F343AD1F44FA8B9022EA23BBE47FD9DD3FB595F5C1EE8F4F765FC3A703B70628EAD7BE2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8BFF4145385FF5C95075ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: 0D63561A33F958A5DF0AF92045ED720FD250EA5D275ABD67F703B7445E9822CAF87CCE6106E1FC07E67D4AC08A07B9B0BFD98ABA943BD70BCB5012B2E24CD356 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF6AC88B16203604B261D2C0F295DE03F732DB277834240D58432E477978984B91F09515A9A3E4BB8DA8B50B9382ADB12A30BEB8E2FCBED0ECEA6164952EBD81D3A74DFFEFA5DC0E7F02C26D483E81D6BE0DBAE6F56676BC7117BB6831D7356A2DEC5B5AD62611EEC62B5AFB4261A09AF0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojqlVu258LHAHwNwAIgsnPCA== X-Mailru-Sender: 11C2EC085EDE56FAC07928AF2646A769F86F68F2908A55E760DA8287ECB4C5287962F9E9328436E1EBA65886582A37BD66FEC6BF5C9C28D98A98C1125256619760D574B6FC815AB872D6B4FCE48DF648AE208404248635DF X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 3/4][v2] cmake: introduce target with codespell X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Sergey On 10/23/23 12:20, Sergey Kaplun wrote: > Hi, Sergey! > Thanks for the patch! > Please, consider my comments below. > > On 11.10.23, Sergey Bronnikov wrote: >> From: Sergey Bronnikov >> >> The patch introduces a new CMake target: "LuaJIT-codespell", that >> spellchecks files specified in a whitelist by codespell [1]. >> >> 1. https://github.com/codespell-project/codespell >> --- >> CMakeLists.txt | 1 + >> cmake/CodeSpell.cmake | 36 ++++++++++++++++++++++++++++++++ >> test/CMakeLists.txt | 1 + >> tools/codespell-ignore-words.txt | 3 +++ >> 4 files changed, 41 insertions(+) >> create mode 100644 cmake/CodeSpell.cmake >> create mode 100644 tools/codespell-ignore-words.txt >> >> diff --git a/CMakeLists.txt b/CMakeLists.txt > > >> diff --git a/cmake/CodeSpell.cmake b/cmake/CodeSpell.cmake >> new file mode 100644 >> index 00000000..c4d3555d >> --- /dev/null >> +++ b/cmake/CodeSpell.cmake >> @@ -0,0 +1,36 @@ >> +find_program(CODESPELL codespell) >> + >> +list(APPEND CODESPELL_WHITELIST ${PROJECT_SOURCE_DIR}/src/lj_mapi.c) >> +list(APPEND CODESPELL_WHITELIST ${PROJECT_SOURCE_DIR}/src/lj_sysprof.c) >> +list(APPEND CODESPELL_WHITELIST ${PROJECT_SOURCE_DIR}/src/lj_utils_leb128.c) >> +list(APPEND CODESPELL_WHITELIST ${PROJECT_SOURCE_DIR}/src/lj_wbuf.c) >> +list(APPEND CODESPELL_WHITELIST ${PROJECT_SOURCE_DIR}/src/luajit-gdb.py) >> +list(APPEND CODESPELL_WHITELIST ${PROJECT_SOURCE_DIR}/src/luajit_lldb.py) >> +list(APPEND CODESPELL_WHITELIST ${PROJECT_SOURCE_DIR}/test/CMakeLists.txt) >> +list(APPEND CODESPELL_WHITELIST ${PROJECT_SOURCE_DIR}/test/tarantool-c-tests) >> +list(APPEND CODESPELL_WHITELIST ${PROJECT_SOURCE_DIR}/test/tarantool-tests) >> +list(APPEND CODESPELL_WHITELIST ${PROJECT_SOURCE_DIR}/tools) > Also, the following files should be checked: > > * src/lib_misc.c > * src/lj_memprof.c > * src/lj_memprof.h > * src/lj_sysprof.h > * src/lj_utils.h > * src/lj_wbuf.h > * src/lmisclib.h > * test/LuaJIT-tests/CMakeLists.txt > * test/PUC-Rio-Lua-5.1-tests/CMakeLists.txt > * test/PUC-Rio-Lua-5.1-tests/CMakeLists.txt > * test/PUC-Rio-Lua-5.1-tests/libs/CMakeLists.txt > * test/lua-Harness-tests/CMakeLists.txt Added: --- a/cmake/CodeSpell.cmake +++ b/cmake/CodeSpell.cmake @@ -1,13 +1,25 @@  find_program(CODESPELL codespell)  string(JOIN "," CODESPELL_WHITELIST +  ${PROJECT_SOURCE_DIR}/src/lib_misc.c    ${PROJECT_SOURCE_DIR}/src/lj_mapi.c +  ${PROJECT_SOURCE_DIR}/src/lj_memprof.c +  ${PROJECT_SOURCE_DIR}/src/lj_memprof.h    ${PROJECT_SOURCE_DIR}/src/lj_sysprof.c +  ${PROJECT_SOURCE_DIR}/src/lj_sysprof.h +  ${PROJECT_SOURCE_DIR}/src/lj_utils.h    ${PROJECT_SOURCE_DIR}/src/lj_utils_leb128.c    ${PROJECT_SOURCE_DIR}/src/lj_wbuf.c +  ${PROJECT_SOURCE_DIR}/src/lj_wbuf.h +  ${PROJECT_SOURCE_DIR}/src/lmisclib.h    ${PROJECT_SOURCE_DIR}/src/luajit-gdb.py    ${PROJECT_SOURCE_DIR}/src/luajit_lldb.py    ${PROJECT_SOURCE_DIR}/test/CMakeLists.txt +  ${PROJECT_SOURCE_DIR}/test/lua-Harness-tests/CMakeLists.txt +  ${PROJECT_SOURCE_DIR}/test/LuaJIT-tests/CMakeLists.txt +  ${PROJECT_SOURCE_DIR}/test/PUC-Rio-Lua-5.1-tests/CMakeLists.txt +  ${PROJECT_SOURCE_DIR}/test/PUC-Rio-Lua-5.1-tests/CMakeLists.txt + ${PROJECT_SOURCE_DIR}/test/PUC-Rio-Lua-5.1-tests/libs/CMakeLists.txt    ${PROJECT_SOURCE_DIR}/test/tarantool-c-tests    ${PROJECT_SOURCE_DIR}/test/tarantool-tests    ${PROJECT_SOURCE_DIR}/tools > >> + >> +set(IGNORE_WORDS ${PROJECT_SOURCE_DIR}/tools/codespell-ignore-words.txt) >> + >> +add_custom_target(${PROJECT_NAME}-codespell) >> +if (CODESPELL) >> + add_custom_command(TARGET ${PROJECT_NAME}-codespell >> + COMMENT "Running codespell" >> + COMMAND >> + ${CODESPELL} >> + --ignore-words ${IGNORE_WORDS} >> + --skip ${IGNORE_WORDS} >> + --ignore-words-list fpr >> + --check-filenames >> + ${CODESPELL_WHITELIST} >> + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} >> + ) >> +else () >> + set(WARN_MSG "`codespell' is not found, " >> + "so ${PROJECT_NAME}-codespell target is dummy") > The output is splitted (thanks CMake). I found the only way to join > lines via `string(CONCAT WARN_MSG )`. Fixed: [1] ~/sources/MRG/tarantool/third_party/luajit$ cmake --build build --parallel -t LuaJIT-codespell codespell is not found, so LuaJIT-codespell target is dummy Built target LuaJIT-codespell @@ -28,8 +40,9 @@ if (CODESPELL)      WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}    )  else () -  set(WARN_MSG "codespell is not found, " -               "so ${PROJECT_NAME}-codespell target is dummy") +  set(STR1 "codespell is not found,") +  set(STR2 "so ${PROJECT_NAME}-codespell target is dummy") +  string(CONCAT WARN_MSG "${STR1} ${STR2}")    add_custom_command(TARGET ${PROJECT_NAME}-codespell      COMMAND ${CMAKE_COMMAND} -E cmake_echo_color --red ${WARN_MSG}      COMMENT ${MSG} > >> + add_custom_command(TARGET ${PROJECT_NAME}-codespell >> + COMMAND ${CMAKE_COMMAND} -E cmake_echo_color --red ${MSG} >> + COMMENT ${MSG} > The ${MSG} is undefined, so this line does nothing and can be deleted. Fixed. > >> + ) >> +endif (CODESPELL) > > >> diff --git a/tools/codespell-ignore-words.txt b/tools/codespell-ignore-words.txt >> new file mode 100644 >> index 00000000..ceeed47c >> --- /dev/null >> +++ b/tools/codespell-ignore-words.txt >> @@ -0,0 +1,3 @@ >> +mmaped > Should it be mmapped instead (like map -> mapped)? removed this work from exclusion list, I don't know why but codespell is not warns about it. > >> +isnt >> +FPR >> -- >> 2.34.1 >>