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 902E56BA767; Wed, 11 Oct 2023 19:54:16 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 902E56BA767 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1697043256; bh=qSm5fspnYNXghicSGiVOWE/ezSbkcC/sodVpcEcvy0o=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=PJic/gsv2jnu/uVZzHvbbRrWHtYbzO1XVkxlL3Ry0oVkgJSbgRx7spjd/h/9V8UZ9 S6zieZwLIhx1sDEFl2pPWnKCmU/ml2acq/Zazp1+iV9jpVo3RpoqQqPfdilXWDK0+B m92QtgsImp7rsKGiAxSkBSP/DIHWxBEZcg9xhS3o= Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 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 5A5956BA767 for ; Wed, 11 Oct 2023 19:52:49 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 5A5956BA767 Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-9ae2cc4d17eso1455766b.1 for ; Wed, 11 Oct 2023 09:52:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697043168; x=1697647968; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2uAKdB3uU+422uLvvwHYUEC4B3VEIq7TVHY/IiOTqrU=; b=BBRApz9GP9QaIGWoaEEBEHLnwmMC1e045LsrWr4J0QqbBXLTZojvgnFKwKNMqdhYLq brvNncZG6yMlqm+aqqEVqb8G1PM51m1MgVgLsIqRvWJBQpsMbYOmboWf59pH8kJOtPGQ fB5zlcPZto1GV2QTNxlEboTecMEj64lAzlWaj1iFGydKPBMUocRIp9loJhMQFs0lCoBM U9tdSDsirpzHIiYi2m7DZhPGhhs49WCrWCYIdaF8+hg2sLDnWTngUgZrFNDlQ9OYjSvo WD/eKqnHj2bGLbhi8tGiLMEytr0ygecj2sCy6wDoOlxD94zZZfqvVbvkKhhdVYoQTddx DvHw== X-Gm-Message-State: AOJu0YxVd+6mFJdXL9+rO1XpaEBPMcV7yzeIXqkibvC461Wei+QjyJnU +FVsmHhK0Xti1KOPRGSrHshoqR5Bo8Y9Kg== X-Google-Smtp-Source: AGHT+IFN8EMCQnDr/iVt08ZGn207MMiicUJDEcwT9bZgFaJMEomeo9WNo3Gq5VGaKkX2kYxlfUq1vQ== X-Received: by 2002:a17:907:7702:b0:9ae:5523:3f84 with SMTP id kw2-20020a170907770200b009ae55233f84mr17478016ejc.72.1697043168107; Wed, 11 Oct 2023 09:52:48 -0700 (PDT) Received: from pony.. ([185.6.247.97]) by smtp.gmail.com with ESMTPSA id l12-20020a170906078c00b009b94fe3fc47sm9962409ejc.159.2023.10.11.09.52.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 09:52:47 -0700 (PDT) To: tarantool-patches@dev.tarantool.org, Sergey Kaplun , max.kokryashkin@gmail.com Date: Wed, 11 Oct 2023 19:52:28 +0300 Message-Id: <0f1c6ed9f0bdade86631edc135839e607f3bb7f6.1697042800.git.sergeyb@tarantool.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [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" 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 index eebf3d6f..7ef10f2f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,6 +32,7 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") include(LuaJITUtils) include(SetBuildParallelLevel) include(SetVersion) +include(CodeSpell) # --- Variables to be exported to child scopes --------------------------------- 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) + +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") + add_custom_command(TARGET ${PROJECT_NAME}-codespell + COMMAND ${CMAKE_COMMAND} -E cmake_echo_color --red ${MSG} + COMMENT ${MSG} + ) +endif (CODESPELL) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 58cba5ba..8afc42df 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -68,6 +68,7 @@ endif() add_custom_target(${PROJECT_NAME}-lint DEPENDS ${PROJECT_NAME}-luacheck ${PROJECT_NAME}-flake8 + ${PROJECT_NAME}-codespell ) set(LUAJIT_TEST_COMMAND "${LUAJIT_TEST_BINARY} -e dofile[[${LUAJIT_TEST_INIT}]]") 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 +isnt +FPR -- 2.34.1