Unverified Commit 0bfccc55 authored by Binbin's avatar Binbin Committed by GitHub
Browse files

Fixed some typos, add a spell check ci and others minor fix (#8890)

This PR adds a spell checker CI action that will fail future PRs if they introduce typos and spelling mistakes.
This spell checker is based on blacklist of common spelling mistakes, so it will not catch everything,
but at least it is also unlikely to cause false positives.

Besides that, the PR also fixes many spelling mistakes and types, not all are a result of the spell checker we use.

Here's a summary of other changes:
1. Scanned the entire source code and fixes all sorts of typos and spelling mistakes (including missing or extra spaces).
2. Outdated function / variable / argument names in comments
3. Fix outdated keyspace masks error log when we check `config.notify-keyspace-events` in loadServerConfigFromString.
4. Trim the white space at the end of line in `module.c`. Check: https://github.com/redis/redis/pull/7751
5. Some outdated https link URLs.
6. Fix some outdated comment. Such as:
    - In README: about the rdb, we used to said create a `thread`, change to `process`
    - dbRandomKey function coment (about the dictGetRandomKey, change to dictGetFairRandomKey)
    - notifyKeyspaceEvent fucntion comment (add type arg)
    - Some others minor fix in comment (Most of them are incorrectly quoted by variable names)
7. Modified the error log so that users can easily distinguish between TCP and TLS in `changeBindAddr`
parent 8a86bca5
......@@ -52,7 +52,7 @@ proc generate_types {} {
generate_collections big 10
# make sure our big stream also has a listpack record that has different
# field names than the master recored
# field names than the master recorded
r xadd streambig * item 1 value 1
r xadd streambig * item 1 unique value
}
......
# tests of corrupt ziplist payload with valid CRC
# * setting crash-memcheck-enabled to no to avoid issues with valgrind
# * setting use-exit-on-panic to yes so that valgrind can search for leaks
# * settng debug set-skip-checksum-validation to 1 on some tests for which we
# * setting debug set-skip-checksum-validation to 1 on some tests for which we
# didn't bother to fake a valid checksum
# * some tests set sanitize-dump-payload to no and some to yet, depending on
# what we want to test
......@@ -214,7 +214,7 @@ test {corrupt payload: hash ziplist uneven record count} {
}
}
test {corrupt payload: hash dupliacte records} {
test {corrupt payload: hash duplicate records} {
# when we do perform full sanitization, we expect duplicate records to fail the restore
start_server [list overrides [list loglevel verbose use-exit-on-panic yes crash-memcheck-enabled no] ] {
r config set sanitize-dump-payload yes
......
......@@ -117,7 +117,7 @@ start_server {} {
set used [list $master_id]
test "PSYNC2: \[NEW LAYOUT\] Set #$master_id as master" {
$R($master_id) slaveof no one
$R($master_id) config set repl-ping-replica-period 1 ;# increse the chance that random ping will cause issues
$R($master_id) config set repl-ping-replica-period 1 ;# increase the chance that random ping will cause issues
if {$counter_value == 0} {
$R($master_id) set x $counter_value
}
......
......@@ -130,7 +130,7 @@ start_server_and_kill_it [list "dir" $server_path] {
start_server {} {
test {Test FLUSHALL aborts bgsave} {
# 1000 keys with 1ms sleep per key shuld take 1 second
# 1000 keys with 1ms sleep per key should take 1 second
r config set rdb-key-save-delay 1000
r debug populate 1000
r bgsave
......
......@@ -419,7 +419,7 @@ test {slave fails full sync and diskless load swapdb recovers it} {
fail "Replica didn't get into loading mode"
}
# make sure that next sync will not start immediately so that we can catch the slave in betweeen syncs
# make sure that next sync will not start immediately so that we can catch the slave in between syncs
$master config set repl-diskless-sync-delay 5
# for faster server shutdown, make rdb saving fast again (the fork is already uses the slow one)
$master config set rdb-key-save-delay 0
......
......@@ -82,7 +82,7 @@ void CommandFilter_CommandFilter(RedisModuleCommandFilterCtx *filter)
* - Remove @delme
* - Replace @replaceme
* - Append @insertbefore or @insertafter
* - Prefix with Log command if @log encounterd
* - Prefix with Log command if @log encountered
*/
int log = 0;
int pos = 0;
......
......@@ -36,7 +36,7 @@
#include <stdio.h>
#include <string.h>
/** strores all the keys on which we got 'loaded' keyspace notification **/
/** stores all the keys on which we got 'loaded' keyspace notification **/
RedisModuleDict *loaded_event_log = NULL;
/** stores all the keys on which we got 'module' keyspace notification **/
RedisModuleDict *module_event_log = NULL;
......
......@@ -75,7 +75,7 @@ void timerNestedHandler(RedisModuleCtx *ctx, void *data) {
int repl = (long long)data;
/* The goal is the trigger a module command that calls RM_Replicate
* in order to test MULTI/EXEC structre */
* in order to test MULTI/EXEC structure */
RedisModule_Replicate(ctx,"INCRBY","cc","timer-nested-start","1");
RedisModuleCallReply *reply = RedisModule_Call(ctx,"propagate-test.nested", repl? "!" : "");
RedisModule_FreeCallReply(reply);
......
......@@ -52,7 +52,7 @@ test "SDOWN is triggered by masters advertising as slaves" {
ensure_master_up
}
test "SDOWN is triggered by misconfigured instance repling with errors" {
test "SDOWN is triggered by misconfigured instance replying with errors" {
ensure_master_up
set orig_dir [lindex [R 0 config get dir] 1]
set orig_save [lindex [R 0 config get save] 1]
......
......@@ -202,7 +202,7 @@ proc tags_acceptable {tags err_return} {
# doesn't really belong here, but highly coupled to code in start_server
proc tags {tags code} {
# If we 'tags' contain multiple tags, quoted and seperated by spaces,
# If we 'tags' contain multiple tags, quoted and separated by spaces,
# we want to get rid of the quotes in order to have a proper list
set tags [string map { \" "" } $tags]
set ::tags [concat $::tags $tags]
......@@ -366,7 +366,7 @@ proc start_server {options {code undefined}} {
set omit $value
}
"tags" {
# If we 'tags' contain multiple tags, quoted and seperated by spaces,
# If we 'tags' contain multiple tags, quoted and separated by spaces,
# we want to get rid of the quotes in order to have a proper list
set tags [string map { \" "" } $value]
set ::tags [concat $::tags $tags]
......
......@@ -498,7 +498,7 @@ proc find_valgrind_errors {stderr on_termination} {
return ""
}
# Look for the absense of a leak free summary (happens when redis isn't terminated properly).
# Look for the absence of a leak free summary (happens when redis isn't terminated properly).
if {(![regexp -- {definitely lost: 0 bytes} $buf] &&
![regexp -- {no leaks are possible} $buf])} {
return $buf
......
......@@ -251,6 +251,6 @@ start_server {tags {"introspection"}} {
}
} {} {external:skip}
# Config file at this point is at a wierd state, and includes all
# Config file at this point is at a weird state, and includes all
# known keywords. Might be a good idea to avoid adding tests here.
}
......@@ -393,7 +393,7 @@ start_server {tags {"defrag external:skip"} overrides {appendonly yes auto-aof-r
# there was an edge case in defrag where all the slabs of a certain bin are exact the same
# % utilization, with the exception of the current slab from which new allocations are made
# if the current slab is lower in utilization the defragger would have ended up in stagnation,
# keept running and not move any allocation.
# kept running and not move any allocation.
# this test is more consistent on a fresh server with no history
start_server {tags {"defrag"} overrides {save ""}} {
r flushdb
......
......@@ -30,7 +30,7 @@ start_server {tags {"modules"}} {
assert_equal [r auth.changecount] 1
}
test {Modules cant authenticate with ACLs users that dont exist} {
test {Modules can't authenticate with ACLs users that dont exist} {
catch { [r auth.authrealuser auth-module-test-fake] } e
assert_match {*Invalid user*} $e
}
......
......@@ -40,7 +40,7 @@ start_server {tags {"modules"}} {
assert_equal [r test.dbsize] 0
}
test {test modle lru api} {
test {test module lru api} {
r config set maxmemory-policy allkeys-lru
r set x foo
set lru [r test.getlru x]
......@@ -59,7 +59,7 @@ start_server {tags {"modules"}} {
}
r config set maxmemory-policy allkeys-lru
test {test modle lfu api} {
test {test module lfu api} {
r config set maxmemory-policy allkeys-lfu
r set x foo
set lfu [r test.getlfu x]
......
......@@ -414,7 +414,7 @@ start_server {tags {"multi"}} {
}
test {MULTI-EXEC body and script timeout} {
# check that we don't run an imcomplete transaction due to some commands
# check that we don't run an incomplete transaction due to some commands
# arriving during busy script
set rd1 [redis_deferring_client]
set r2 [redis_client]
......
......@@ -131,7 +131,7 @@ start_server {tags {"obuf-limits external:skip"}} {
after 100
# Create a pipeline of commands that will be processed in one socket read.
# It is important to use one write, in TLS mode independant writes seem
# It is important to use one write, in TLS mode independent writes seem
# to wait for response from the server.
# Total size should be less than OS socket buffer, redis can
# execute all commands in this pipeline when it wakes up.
......
......@@ -272,7 +272,7 @@ start_server {tags {"scripting"}} {
local encoded = cmsgpack.pack(a)
local h = ""
-- cmsgpack encodes to a depth of 16, but can't encode
-- references, so the encoded object has a deep copy recusive
-- references, so the encoded object has a deep copy recursive
-- depth of 16.
for i = 1, #encoded do
h = h .. string.format("%02x",string.byte(encoded,i))
......
......@@ -640,7 +640,7 @@ start_server {
set item [$slave xreadgroup group mygroup myconsumer \
COUNT 1 STREAMS stream >]
# The consumed enty should be the third
# The consumed entry should be the third
set myentry [lindex $item 0 1 0 1]
assert {$myentry eq {a 3}}
}
......
......@@ -30,7 +30,7 @@ uint16_t minutes_diff(uint16_t now, uint16_t prev) {
return 65535-prev+now;
}
/* Increment a couter logaritmically: the greatest is its value, the
/* Increment a counter logarithmically: the greatest is its value, the
* less likely is that the counter is really incremented.
* The maximum value of the counter is saturated at 255. */
uint8_t log_incr(uint8_t counter) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment