diff --git a/benchmark/monetdb/usability.md b/benchmark/monetdb/usability.md index 20eaf37f9e8..741079b5663 100644 --- a/benchmark/monetdb/usability.md +++ b/benchmark/monetdb/usability.md @@ -2,7 +2,7 @@ Go to https://www.monetdb.org/ The graphical design of the website is a bit old-fashioned but I do not afraid. -Dowload now. +Download now. Latest binary releases. Ubuntu & Debian. @@ -1103,7 +1103,7 @@ Ok, it's doing something at least for twenty minues... clk: 28:02 min ``` -Finally it has loaded data successfuly in 28 minutes. It's not fast - just below 60 000 rows per second. +Finally it has loaded data successfully in 28 minutes. It's not fast - just below 60 000 rows per second. But the second query from the test does not work: diff --git a/docker/test/style/Dockerfile b/docker/test/style/Dockerfile index 0f5c8d35fa9..1a4356caced 100644 --- a/docker/test/style/Dockerfile +++ b/docker/test/style/Dockerfile @@ -1,7 +1,7 @@ -# docker build -t yandex/clickhouse-style-test . +# docker build -t yandex/clickhouse-style-test . FROM ubuntu:20.04 -RUN apt-get update && env DEBIAN_FRONTEND=noninteractive apt-get install --yes shellcheck libxml2-utils git +RUN apt-get update && env DEBIAN_FRONTEND=noninteractive apt-get install --yes shellcheck libxml2-utils git python3-pip && pip3 install codespell CMD cd /ClickHouse/utils/check-style && ./check-style -n | tee /test_output/style_output.txt && \ diff --git a/programs/server/Server.cpp b/programs/server/Server.cpp index fdefd217e61..0298528424c 100644 --- a/programs/server/Server.cpp +++ b/programs/server/Server.cpp @@ -356,7 +356,7 @@ int Server::main(const std::vector & /*args*/) std::string path = getCanonicalPath(config().getString("path", DBMS_DEFAULT_PATH)); std::string default_database = config().getString("default_database", "default"); - /// Check that the process' user id matches the owner of the data. + /// Check that the process user id matches the owner of the data. const auto effective_user_id = geteuid(); struct stat statbuf; if (stat(path.c_str(), &statbuf) == 0 && effective_user_id != statbuf.st_uid) diff --git a/src/Common/tests/gtest_thread_pool_schedule_exception.cpp b/src/Common/tests/gtest_thread_pool_schedule_exception.cpp index 73fdce1cad8..95b983cc3bb 100644 --- a/src/Common/tests/gtest_thread_pool_schedule_exception.cpp +++ b/src/Common/tests/gtest_thread_pool_schedule_exception.cpp @@ -20,7 +20,7 @@ static bool check() /// as soon as the throwing thread executed. /// This innocent thread may or may not be executed, the following possibilities exist: - /// 1. The throwing thread has already throwed exception and the attempt to schedule the innocent thread will rethrow it. + /// 1. The throwing thread has already thrown exception and the attempt to schedule the innocent thread will rethrow it. /// 2. The throwing thread has not executed, the innocent thread will be scheduled and executed. /// 3. The throwing thread has not executed, the innocent thread will be scheduled but before it will be executed, /// the throwing thread will be executed and throw exception and it will prevent starting of execution of the innocent thread diff --git a/src/Processors/Pipe.cpp b/src/Processors/Pipe.cpp index e6749827efe..93dcd561c00 100644 --- a/src/Processors/Pipe.cpp +++ b/src/Processors/Pipe.cpp @@ -74,7 +74,7 @@ static OutputPort * uniteTotals(const OutputPortRawPtrs & ports, const Block & h if (ports.size() == 1) return ports.front(); - /// Calculate totals fro several streams. + /// Calculate totals from several streams. /// Take totals from first sources which has any, skip others. /// ->> Concat -> Limit diff --git a/utils/check-style/check-style b/utils/check-style/check-style index 59df5f17808..83284125681 100755 --- a/utils/check-style/check-style +++ b/utils/check-style/check-style @@ -69,6 +69,10 @@ find $ROOT_PATH -name '.gitmodules' | while read i; do grep -F 'url = ' $i | gre # There shouldn't be any code snippets under GPL or LGPL find $ROOT_PATH/{src,base,programs} -name '*.h' -or -name '*.cpp' 2>/dev/null | xargs grep -i -F 'General Public License' && echo "There shouldn't be any code snippets under GPL or LGPL" +# Check for typos in code +CURDIR=$(dirname "${BASH_SOURCE[0]}") +"${CURDIR}"/check-typos + # Check sh tests with Shellcheck (cd $ROOT_PATH/tests/queries/0_stateless/ && shellcheck --check-sourced --external-sources --severity info --exclude SC1071,SC2086 *.sh ../1_stateful/*.sh) diff --git a/utils/check-style/check-typos b/utils/check-style/check-typos new file mode 100755 index 00000000000..14deb039059 --- /dev/null +++ b/utils/check-style/check-typos @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +# Check for typos in code. + +ROOT_PATH=$(git rev-parse --show-toplevel) +CURDIR=$(dirname "${BASH_SOURCE[0]}") + +codespell \ + --skip '*generated*,*gperf*,*.bin,*.mrk*,*.idx,checksums.txt,*.dat,*.pyc,*.kate-swp' \ + --ignore-words "${CURDIR}/codespell-ignore-words.list" \ + --exclude-file "${CURDIR}/codespell-ignore-lines.list" \ + --quiet-level 2 \ + "$ROOT_PATH"/{src,base,programs,utils} \ + $@ | grep -P '.' \ + && echo -e "\nFound some typos in code.\nSee the files utils/check-style/codespell* if you want to add an exception." diff --git a/utils/check-style/codespell-ignore-lines.list b/utils/check-style/codespell-ignore-lines.list new file mode 100644 index 00000000000..7c2959e9468 --- /dev/null +++ b/utils/check-style/codespell-ignore-lines.list @@ -0,0 +1,6 @@ +/// https://groups.google.com/forum/#!searchin/kona-dev/variadic$20macro%7Csort:date/kona-dev/XMA-lDOqtlI/GCzdfZsD41sJ +Jo-Philipp Wich +The TRE regular expression implementation (src/regex/reg* and +src/regex/tre*) is Copyright © 2001-2008 Ville Laurikari and licensed + pullRequests(first: {min_page_size} baseRefName: "{base}" headRefName: "{head}") {{ + uint64_t time_to_wait = nanoseconds * timebase_info.denom / timebase_info.numer; diff --git a/utils/check-style/codespell-ignore-words.list b/utils/check-style/codespell-ignore-words.list new file mode 100644 index 00000000000..4433e9917e3 --- /dev/null +++ b/utils/check-style/codespell-ignore-words.list @@ -0,0 +1,7 @@ +thenn +fpr +creat +parsering +nd +ect +pullrequest