Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .codespell/.codespellrc

This file was deleted.

1 change: 0 additions & 1 deletion .codespell/requirements.txt

This file was deleted.

21 changes: 0 additions & 21 deletions .codespell/wordlist.txt

This file was deleted.

61 changes: 61 additions & 0 deletions .config/typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# See https://github.com/crate-ci/typos/blob/master/docs/reference.md to configure typos

[files]
extend-exclude = [
"deps/",
# crc16_slottable is primarily pre-generated random strings.
"src/crc16_slottable.h",
]

[default.extend-words]
exat = "exat"
optin = "optin"
smove = "smove"

[type.c]
extend-ignore-re = [
"BA3E2571", # sha1.c
"D4C4DAA4", # sha1.c
"Georg Nees",
"\\[l\\]ist", # eval.c
]

[type.tcl]
extend-ignore-re = [
"DUMPed",
]

[type.sv.extend-identifiers]
# sv = .h
module_gil_acquring = "module_gil_acquring"

[type.c.extend-identifiers]
clen = "clen"
fle = "fle"
module_gil_acquring = "module_gil_acquring"
nd = "nd"
ot = "ot"

[type.tcl.extend-identifiers]
fo = "fo"
oll = "oll"
stressers = "stressers"

[type.sv.extend-words]
# sv = .h
fo = "fo"
seeked = "seeked"

[type.c.extend-words]
fo = "fo"
limite = "limite"
seeked = "seeked"
tre = "tre"

[type.systemd.extend-words]
# systemd = .conf
ake = "ake"

[type.tcl.extend-words]
fo = "fo"
tre = "tre"
6 changes: 1 addition & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,10 @@
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

---
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
- package-ecosystem: pip
directory: /.codespell
schedule:
interval: weekly
13 changes: 4 additions & 9 deletions .github/workflows/spell-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: pip cache
uses: actions/cache@v4
- name: Install typos
uses: taiki-e/install-action@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: ${{ runner.os }}-pip-

- name: Install prerequisites
run: sudo pip install -r ./.codespell/requirements.txt
tool: typos

- name: Spell check
run: codespell --config=./.codespell/.codespellrc
run: typos --config=./.config/typos.toml
2 changes: 1 addition & 1 deletion src/atomicvar.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* (if the flag was 0 -> set to 1, if it's already 1 -> do nothing, but the final result is that the flag is set),
* and also it has a full barrier (__sync_lock_test_and_set has acquire barrier).
*
* NOTE2: Unlike other atomic type, which aren't guaranteed to be lock free, c11 atmoic_flag does.
* NOTE2: Unlike other atomic type, which aren't guaranteed to be lock free, c11 atomic_flag does.
* To check whether a type is lock free, atomic_is_lock_free() can be used.
* It can be considered to limit the flag type to atomic_flag to improve performance.
*
Expand Down
2 changes: 1 addition & 1 deletion src/script_lua.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*
* * Execute Lua code, assuming that the code is located on
* the top of the Lua stack. In addition, parsing the execution
* result and convert it to the resp and reply ot the client.
* result and convert it to the resp and reply to the client.
*
* * Run Redis commands from within the Lua code (Including
* parsing the reply and create a Lua object out of it).
Expand Down
4 changes: 2 additions & 2 deletions src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -2575,7 +2575,7 @@ void resetServerStats(void) {
}

/* Make the thread killable at any time, so that kill threads functions
* can work reliably (default cancelability type is PTHREAD_CANCEL_DEFERRED).
* can work reliably (default cancellability type is PTHREAD_CANCEL_DEFERRED).
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://en.wiktionary.org/wiki/cancelability and the note at the bottom of https://www.merriam-webster.com/dictionary/cancel suggests this was an acceptable alternative , but given it only appears once, and it looks like it will get flagged by multiple spellcheckers, it seems wise to just switch to using the spelling commonly used.

* Needed for pthread_cancel used by the fast memory test used by the crash report. */
void makeThreadKillable(void) {
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
Expand Down Expand Up @@ -6580,7 +6580,7 @@ void dismissClientMemory(client *c) {
/* In the child process, we don't need some buffers anymore, and these are
* likely to change in the parent when there's heavy write traffic.
* We dismiss them right away, to avoid CoW.
* see dismissMemeory(). */
* see dismissMemory(). */
void dismissMemoryInChild(void) {
/* madvise(MADV_DONTNEED) may not work if Transparent Huge Pages is enabled. */
if (server.thp_enabled) return;
Expand Down
4 changes: 2 additions & 2 deletions src/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -1989,7 +1989,7 @@ struct redisServer {
xor of NOTIFY_... flags. */
kvstore *pubsubshard_channels; /* Map shard channels in every slot to list of subscribed clients */
unsigned int pubsub_clients; /* # of clients in Pub/Sub mode */
unsigned int watching_clients; /* # of clients are wathcing keys */
unsigned int watching_clients; /* # of clients are watching keys */
/* Cluster */
int cluster_enabled; /* Is cluster enabled? */
int cluster_port; /* Set the cluster port for a node. */
Expand Down Expand Up @@ -3432,7 +3432,7 @@ void blockForAofFsync(client *c, mstime_t timeout, long long offset, int numloca
void signalDeletedKeyAsReady(redisDb *db, robj *key, int type);
void updateStatsOnUnblock(client *c, long blocked_us, long reply_us, int had_errors);
void scanDatabaseForDeletedKeys(redisDb *emptied, redisDb *replaced_with);
void totalNumberOfStatefulKeys(unsigned long *blocking_keys, unsigned long *bloking_keys_on_nokey, unsigned long *watched_keys);
void totalNumberOfStatefulKeys(unsigned long *blocking_keys, unsigned long *blocking_keys_on_nokey, unsigned long *watched_keys);
void blockedBeforeSleep(void);

/* timeout.c -- Blocked clients timeout and connections timeout. */
Expand Down
2 changes: 1 addition & 1 deletion src/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -1631,7 +1631,7 @@ static void test_reclaimFilePageCache(void) {
assert(!cache_exist(fd));

unlink(tmpfile);
printf("reclaimFilePageCach test is ok\n");
printf("reclaimFilePageCache test is ok\n");
}
#endif

Expand Down
2 changes: 1 addition & 1 deletion tests/assets/test_cli_hint_suite.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
# Two-word command with multiple non-token block args: CONFIG SET parameter value [parameter value ...]
"CONFIG SET param " "value [parameter value ...]"
"CONFIG SET param val " "[parameter value ...]"
"CONFIG SET param val parm2 val2 " "[parameter value ...]"
"CONFIG SET param val param2 val2 " "[parameter value ...]"

# Command with nested optional args: ZRANDMEMBER key [count [WITHSCORES]]
"ZRANDMEMBER k " "[count [WITHSCORES]]"
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/rdb.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ start_server {} {
# make sure a write command fails
assert_error {MISCONF *} {r set x y}

# repeate with script
# repeat with script
assert_error {MISCONF *} {r eval {
return redis.call('set','x',1)
} 1 x
Expand Down
8 changes: 4 additions & 4 deletions tests/modules/fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
#define UNUSED(V) ((void) V)

int child_pid = -1;
int exitted_with_code = -1;
int exited_with_code = -1;

void done_handler(int exitcode, int bysignal, void *user_data) {
child_pid = -1;
exitted_with_code = exitcode;
exited_with_code = exitcode;
assert(user_data==(void*)0xdeadbeef);
UNUSED(bysignal);
}
Expand All @@ -36,7 +36,7 @@ int fork_create(RedisModuleCtx *ctx, RedisModuleString **argv, int argc)

RedisModule_StringToLongLong(argv[1], &code_to_exit_with);
RedisModule_StringToLongLong(argv[2], &usleep_us);
exitted_with_code = -1;
exited_with_code = -1;
int fork_child_pid = RedisModule_Fork(done_handler, (void*)0xdeadbeef);
if (fork_child_pid < 0) {
RedisModule_ReplyWithError(ctx, "Fork failed");
Expand All @@ -61,7 +61,7 @@ int fork_exitcode(RedisModuleCtx *ctx, RedisModuleString **argv, int argc)
{
UNUSED(argv);
UNUSED(argc);
RedisModule_ReplyWithLongLong(ctx, exitted_with_code);
RedisModule_ReplyWithLongLong(ctx, exited_with_code);
return REDISMODULE_OK;
}

Expand Down
52 changes: 26 additions & 26 deletions tests/support/response_transformers.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace eval response_transformers {}

# Transform a map response into an array of tuples (tuple = array with 2 elements)
# Used for XREAD[GROUP]
proc transfrom_map_to_tupple_array {argv response} {
proc transform_map_to_tuple_array {argv response} {
set tuparray {}
foreach {key val} $response {
set tmp {}
Expand All @@ -32,7 +32,7 @@ proc transfrom_map_to_tupple_array {argv response} {
}

# Transform an array of tuples to a flat array
proc transfrom_tuple_array_to_flat_array {argv response} {
proc transform_tuple_array_to_flat_array {argv response} {
set flatarray {}
foreach pair $response {
lappend flatarray {*}$pair
Expand All @@ -42,51 +42,51 @@ proc transfrom_tuple_array_to_flat_array {argv response} {

# With HRANDFIELD, we only need to transform the response if the request had WITHVALUES
# (otherwise the returned response is a flat array in both RESPs)
proc transfrom_hrandfield_command {argv response} {
proc transform_hrandfield_command {argv response} {
foreach ele $argv {
if {[string compare -nocase $ele "WITHVALUES"] == 0} {
return [transfrom_tuple_array_to_flat_array $argv $response]
return [transform_tuple_array_to_flat_array $argv $response]
}
}
return $response
}

# With some zset commands, we only need to transform the response if the request had WITHSCORES
# (otherwise the returned response is a flat array in both RESPs)
proc transfrom_zset_withscores_command {argv response} {
proc transform_zset_withscores_command {argv response} {
foreach ele $argv {
if {[string compare -nocase $ele "WITHSCORES"] == 0} {
return [transfrom_tuple_array_to_flat_array $argv $response]
return [transform_tuple_array_to_flat_array $argv $response]
}
}
return $response
}

# With ZPOPMIN/ZPOPMAX, we only need to transform the response if the request had COUNT (3rd arg)
# (otherwise the returned response is a flat array in both RESPs)
proc transfrom_zpopmin_zpopmax {argv response} {
proc transform_zpopmin_zpopmax {argv response} {
if {[llength $argv] == 3} {
return [transfrom_tuple_array_to_flat_array $argv $response]
return [transform_tuple_array_to_flat_array $argv $response]
}
return $response
}

set ::trasformer_funcs {
XREAD transfrom_map_to_tupple_array
XREADGROUP transfrom_map_to_tupple_array
HRANDFIELD transfrom_hrandfield_command
ZRANDMEMBER transfrom_zset_withscores_command
ZRANGE transfrom_zset_withscores_command
ZRANGEBYSCORE transfrom_zset_withscores_command
ZRANGEBYLEX transfrom_zset_withscores_command
ZREVRANGE transfrom_zset_withscores_command
ZREVRANGEBYSCORE transfrom_zset_withscores_command
ZREVRANGEBYLEX transfrom_zset_withscores_command
ZUNION transfrom_zset_withscores_command
ZDIFF transfrom_zset_withscores_command
ZINTER transfrom_zset_withscores_command
ZPOPMIN transfrom_zpopmin_zpopmax
ZPOPMAX transfrom_zpopmin_zpopmax
set ::transformer_funcs {
XREAD transform_map_to_tuple_array
XREADGROUP transform_map_to_tuple_array
HRANDFIELD transform_hrandfield_command
ZRANDMEMBER transform_zset_withscores_command
ZRANGE transform_zset_withscores_command
ZRANGEBYSCORE transform_zset_withscores_command
ZRANGEBYLEX transform_zset_withscores_command
ZREVRANGE transform_zset_withscores_command
ZREVRANGEBYSCORE transform_zset_withscores_command
ZREVRANGEBYLEX transform_zset_withscores_command
ZUNION transform_zset_withscores_command
ZDIFF transform_zset_withscores_command
ZINTER transform_zset_withscores_command
ZPOPMIN transform_zpopmin_zpopmax
ZPOPMAX transform_zpopmin_zpopmax
}

proc ::response_transformers::transform_response_if_needed {id argv response} {
Expand All @@ -95,11 +95,11 @@ proc ::response_transformers::transform_response_if_needed {id argv response} {
}

set key [string toupper [lindex $argv 0]]
if {![dict exists $::trasformer_funcs $key]} {
if {![dict exists $::transformer_funcs $key]} {
return $response
}

set transform [dict get $::trasformer_funcs $key]
set transform [dict get $::transformer_funcs $key]

return [$transform $argv $response]
}
6 changes: 3 additions & 3 deletions tests/unit/acl.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -666,16 +666,16 @@ start_server {tags {"acl external:skip"}} {
for {set j 0} {$j < 10} {incr j} {
assert_error "*WRONGPASS*" {r AUTH user1 doo}
}
set entry_id_lastest_error [dict get [lindex [r ACL LOG] 0] entry-id]
set entry_id_latest_error [dict get [lindex [r ACL LOG] 0] entry-id]
set timestamp_created_updated [dict get [lindex [r ACL LOG] 0] timestamp-created]
set timestamp_last_updated_after_update [dict get [lindex [r ACL LOG] 0] timestamp-last-updated]
assert {$entry_id_lastest_error eq $entry_id_initial_error}
assert {$entry_id_latest_error eq $entry_id_initial_error}
assert {$timestamp_last_update_original < $timestamp_last_updated_after_update}
assert {$timestamp_created_original eq $timestamp_created_updated}
r ACL setuser user2 >doo
assert_error "*WRONGPASS*" {r AUTH user2 foo}
set new_error_entry_id [dict get [lindex [r ACL LOG] 0] entry-id]
assert {$new_error_entry_id eq $entry_id_lastest_error + 1 }
assert {$new_error_entry_id eq $entry_id_latest_error + 1 }
}

test {ACL LOG shows failed command executions at toplevel} {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/moduleapi/misc.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ start_server {overrides {save {900 1}} tags {"modules"}} {
# rm_call in script mode
assert_error {MISCONF *} {r test.rm_call_flags S set x 1}

# repeate with script
# repeat with script
assert_error {MISCONF *} {r test.rm_call eval {
return redis.call('set','x',1)
} 1 x
Expand Down
Loading