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 27B8A6757C3; Mon, 23 Oct 2023 17:43:15 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 27B8A6757C3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1698072195; bh=rgsNCxl8jP4/Hostuk38Kd5mo3fr5zj/EUBfbrvaie4=; 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=LdP8H1HyvWsZZT3RvBk1ZZdb4ir6pN1NuwvsHEbl5s5bREN+GyF9WL6inhg44mzx3 NRyjqMZZXS1Xrpwgbq/JyEPbXeI9DUHjZy1XwnCDWsZCZFuT7anK2+ze/FlCM25s17 L7yk3LiqSkO8DkdGdnmIzhV9s8NhD6D7cVsyEWBw= Received: from smtpng1.i.mail.ru (smtpng1.i.mail.ru [94.100.181.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id F0F6A6750FB for ; Mon, 23 Oct 2023 17:43:13 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org F0F6A6750FB Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1quw9B-0001Wp-4U; Mon, 23 Oct 2023 17:43:13 +0300 Date: Mon, 23 Oct 2023 17:38:44 +0300 To: Sergey Bronnikov Cc: Sergey Bronnikov , tarantool-patches@dev.tarantool.org, max.kokryashkin@gmail.com Message-ID: References: <0f1c6ed9f0bdade86631edc135839e607f3bb7f6.1697042800.git.sergeyb@tarantool.org> <4b791cd8-0174-4cff-9c4d-7faa5eff8550@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4b791cd8-0174-4cff-9c4d-7faa5eff8550@tarantool.org> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: EEAE043A70213CC8 X-77F55803: 4F1203BC0FB41BD9D4445358DD2C13E2E903C7A6A68D727B71DDDEE73AD8C575182A05F538085040028C8A250C24615A14D051DAF1050EC9A53B67BD97C6093CDFF955A1342D70D4 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE78BAADB77C21FF6F2EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006372A285F85D463FE138638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D878883A2FE3689CB38413F7763E4D1D29117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC292D688DDAD4E7BC389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC87AE820D2C17D0E56F6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA7E827F84554CEF5019E625A9149C048EE33AC447995A7AD183FC91FA280E0CE3D3A03B725D353964B0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E7355E1C53F199C2BB95B5C8C57E37DE458BEDA766A37F9254B7 X-C1DE0DAB: 0D63561A33F958A5A516D4AA580D1CF91BC00C6D861A5A12788F729AA0C20F41F87CCE6106E1FC07E67D4AC08A07B9B04E7D9683544204AFCB5012B2E24CD356 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CFCBE2C78AAE38C9C6C2FBC78F6CF48EE56223E9988CEC6B0285842CD48A0B5900286507CB17C9CD82A8B50B9382ADB12A4BB3803243487293BDE852DF148BC1A7A74DFFEFA5DC0E7F02C26D483E81D6BE5EF9655DD6DEA7D65774BB76CC95456EEC5B5AD62611EEC62B5AFB4261A09AF0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojqlVu258LHAEkz8Y7f4mIaQ== X-DA7885C5: 307376CD7A5D57ED674125B68804C7F25EAA9749713A50CD956E77C4CC48D9CD262E2D401490A4A0DB037EFA58388B346E8BC1A9835FDE71 X-Mailru-Sender: 689FA8AB762F73930F533AC2B33E986B7B2F9D65B7A8D14B247A30DD1E54F6FF0FBE9A32752B8C9C2AA642CC12EC09F1FB559BB5D741EB962F61BD320559CF1EFD657A8799238ED55FEEDEB644C299C0ED14614B50AE0675 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 Kaplun via Tarantool-patches Reply-To: Sergey Kaplun Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Sergey! Thanks for the fixes! LGTM, just minor nits below. On 23.10.23, Sergey Bronnikov wrote: > 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 Side note: within vim's (sort 'l' is greater then 'L', see `man ascii`), but I'm OK with this order too. > > > > >> + > >> +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}") Oh, may be just the following? | string(CONCAT WARN_MSG | "codespell is not found," | "so ${PROJECT_NAME}-codespell target is dummy" | ) >    add_custom_command(TARGET ${PROJECT_NAME}-codespell >      COMMAND ${CMAKE_COMMAND} -E cmake_echo_color --red ${WARN_MSG} >      COMMENT ${MSG} > > > > >> +++ 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. I suppose, that some files aren't covered... | codespell --ignore-words tools/codespell-ignore-words.txt | ... | ./test/tarantool-c-tests/lj-49-bad-lightuserdata.test.c:42: mmaped ==> mapped | ./test/tarantool-c-tests/lj-49-bad-lightuserdata.test.c:44: mmaped ==> mapped | ./test/tarantool-c-tests/lj-49-bad-lightuserdata.test.c:45: mmaped ==> mapped | ./test/tarantool-c-tests/lj-49-bad-lightuserdata.test.c:46: mmaped ==> mapped | ./test/tarantool-c-tests/lj-49-bad-lightuserdata.test.c:47: mmaped ==> mapped So, maybe we should use mmapped and also add it to the ignore-words? > > > >> +isnt > >> +FPR > >> -- > >> 2.34.1 > >> -- Best regards, Sergey Kaplun