Repository navigation
Conversation
Signed-off-by: Josh Soref <[email protected]>
jsoref
left a comment
There was a problem hiding this comment.
check pointing. I'll continue momentarily
| # Building Valkey using `Makefile` | ||
|
|
||
| Valkey can be compiled and used on Linux, OSX, OpenBSD, NetBSD, FreeBSD. | ||
| Valkey can be compiled and used on Linux, macOS, OpenBSD, NetBSD, FreeBSD. |
There was a problem hiding this comment.
macOS is a fun story. This is the current product name. In some cases, what's being referenced is one of the earlier product names, I'll tag an example...
| return ACL_DENIED_KEY; | ||
| } | ||
|
|
||
| /* Checks if the provided selector selector has access specified in flags |
There was a problem hiding this comment.
I know that one can imagine this to mean "an object type selector" followed by "an object named selector", but that isn't helpful and the actual type is aclSelector and that too doesn't add value. Humans are capable of understanding that an object named selector is a selector and inferring that it's an aclSelector or whatever.
| * where 0 is the head, 1 is the element next to head | ||
| * and so on. Negative integers are used in order to count | ||
| * from the tail, -1 is the last element, -2 the penultimate | ||
| * and so on. If the index is out of range NULL is returned. */ |
There was a problem hiding this comment.
This isn't precisely a spelling item (nor is the duplicate word fix), but my tooling includes some heuristics for various other errors, and this is strictly speaking an improvement that happens to make one of those heuristics happy.
| /* Get the bin index in bin array from the reg_size. | ||
| * | ||
| * these are reverse engineered mapping of reg_size -> binind. We need this information because the utilization query | ||
| * these are reverse engineered mapping of reg_size -> bin_index. We need this information because the utilization query |
There was a problem hiding this comment.
I'm not entirely certain about this, but binind is only used in a tiny corner of this repository, and this code does use _s some of the time, so I'm hoping I'm right about what it's trying to reference and that this is ok.
Note that there are plenty of other places where I'd be happy to add more snake_case or camelCase to make reading easier (and simplify things for tooling), but I generally haven't.
| /* For empty ranges (start > end) we return -1 as an empty range does | ||
| * not contain a 0 nor a 1. */ | ||
| /* For empty ranges (start > end) we return -1 as an empty range contains | ||
| * neither 0 nor 1. */ |
There was a problem hiding this comment.
This is based on another heuristic that suggests using neither-nor. In most cases, I've gone for that, although in a handful of cases, such as this, I've opted to rewrite things in other ways that I hope improve the text.
| /* OSX */ | ||
| /* Mac OS X */ | ||
| #if defined(__APPLE__) && defined(MAC_OS_10_6_DETECTED) | ||
| /* OSX AMD64 */ | ||
| /* Mac OS X AMD64 */ |
There was a problem hiding this comment.
AMD64 was present as of 10.4, and the macro checks for 10.6, so the comment should use the 10.6 era brand
| * It does not guarantee to return all the keys specified in 'count', nor | ||
| * it does guarantee to return non-duplicated elements, however it will make | ||
| * It neither guarantees it will return all the keys specified in 'count', nor | ||
| * does it guarantee to return non-duplicated elements, however it will make |
There was a problem hiding this comment.
this is an atypical neither-nor correction.
| * because allocating and deallocating this object is costly | ||
| * (according to the profiler, not my fantasy. Remember: | ||
| * premature optimization bla bla bla. */ | ||
| * premature optimization blah, blah, blah. */ |
There was a problem hiding this comment.
blah is a word, and I'm proposing to use it consistently both in comments (as here) and in code. The commas here are proper for English...
I'm happy to drop anything as requested...
| /* | ||
| * On NetBSD, _XOPEN_SOURCE undefines _NETBSD_SOURCE and | ||
| * thus hides inet_aton etc. | ||
| * thus hides inet_aton, etc. |
There was a problem hiding this comment.
I have half a rule for , etc. but I didn't actually deploy it for this repository. This ended up being an in-the-neighborhood correction (I was checking up on a heuristic to tolerate aton and spotted it).
| } | ||
|
|
||
| restorePolicy restore_replicy = restorePolicy_Append; /* default policy: APPEND */ | ||
| restorePolicy restore_policy = restorePolicy_Append; /* default policy: APPEND */ |
There was a problem hiding this comment.
I hope this is right.
There was a problem hiding this comment.
This is a weird one. I'm unsure if that should be changed.
| * [BYBOX width height unit] [WITHCOORD] [WITHDIST] [WITHASH] [COUNT count [ANY]] [ASC|DESC] | ||
| * [BYBOX width height unit] [WITHCOORD] [WITHDIST] [WITHHASH] [COUNT count [ANY]] [ASC|DESC] | ||
| * GEOSEARCHSTORE dest_key src_key [FROMMEMBER member] [FROMLONLAT long lat] [BYRADIUS radius unit] | ||
| * [BYBOX width height unit] [COUNT count [ANY]] [ASC|DESC] [STOREDIST] |
There was a problem hiding this comment.
To make my life easier, I was adding patterns for various prefixes. I'm very glad that I didn't add such a pattern for WITH, otherwise I would have missed this as it would have seen ASH which is a valid word.
If people want to add check-spelling, I'd probably remove those patterns and instead add the items that were covered allow.txt or expect.txt.
| /* Reflects about 6nm on earth for comparing longitudes. */ | ||
| const double GEO_EPSILON = 1e-15; | ||
| /* if v == 0, or practically 0, we can avoid doing expensive math when lons are practically the same */ | ||
| /* if v == 0, or practically 0, we can avoid doing expensive math when longitudes are practically the same */ |
There was a problem hiding this comment.
I understand lon+s, but it was the only use in the repository, longitudes is used in this file, and there didn't seem to be any good reason to shorten it....
| do { | ||
| /* Emit entries in the larger table at this cursor, if this index | ||
| * hash't already been rehashed. */ | ||
| * hasn't already been rehashed. */ |
There was a problem hiding this comment.
I think this was an in-the-neighborhood fix. (A rule against this typo could be added if people expect it to recur.)
| } | ||
|
|
||
| /* PFADD var ele ele ele ... ele => :0 or :1 */ | ||
| /* PFADD var ele ele ... ele => :0 or :1 */ |
There was a problem hiding this comment.
| * the correct value to be retained and not affect adjacent values. */ | ||
| for (j = 0; j < HLL_TEST_CYCLES; j++) { | ||
| /* Set the HLL counters and an array of unsigned byes of the | ||
| /* Set the HLL counters and an array of unsigned bytes of the |
There was a problem hiding this comment.
this is amusing and was an in-the-neighborhood catch+fix (the word is in the dictionary, it just isn't the right word). I've since added a rule to spell-check-this because of this.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## unstable #2183 +/- ##
============================================
- Coverage 71.44% 71.39% -0.05%
============================================
Files 122 122
Lines 66206 66206
============================================
- Hits 47300 47271 -29
- Misses 18906 18935 +29
🚀 New features to boost your workflow:
|
jsoref
left a comment
There was a problem hiding this comment.
All done.
Fwiw, GitHub's PR viewer isn't particularly good for a PR of this size. If you have VSCode, you can use the GitHub Pull Requests add-on to view the PR. I didn't this time even though I know better.
| * It is efficient because does not create an SDS object nor an Object | ||
| * if not needed. The object will only be created by calling | ||
| * _addReplyProtoToList() if we fail to extend the existing tail object | ||
| * in the list of objects. */ | ||
| * It is efficient because it does not needlessly create an SDS object/Object. | ||
| * The object will only be created by calling _addReplyProtoToList() if we | ||
| * fail to extend the existing tail object in the list of objects. */ |
There was a problem hiding this comment.
This is one of the other non-trivial neither-nor rule rewrites.
The original text is really hard to read. I hope my change is correct and improves things.
| raxSeek(&ri, "^", NULL, 0); | ||
| while (raxNext(&ri)) { | ||
| /* We store IDs in raw form as 128 big big endian numbers, like | ||
| /* We store IDs in raw form as 128 bit big endian numbers, like |
There was a problem hiding this comment.
this was caught by the duplicate word forbidden pattern.
There's actually a second variation of this bug in
Line 1043 in 988297d
which I didn't see because the rule that complained here didn't see " big big " there.
I'll fix that instance. And probably also add a - between big and endian here. (Plus probably apply that throughout the repository.)
|
|
||
| if (ibv_query_device(cm_id->verbs, &device_attr)) { | ||
| serverLog(LL_WARNING, "RDMA: ibv ibv query device failed"); | ||
| serverLog(LL_WARNING, "RDMA: ibv query device failed"); |
There was a problem hiding this comment.
this and the item below are notable. I don't speak RDMA/ibv. But most of the items in this file don't duplicate ibv so I'm guessing this is an error, but I could definitely be wrong.
There was a problem hiding this comment.
I'm hesitant to change user logs or error messages but I believe RDMA is an experimental feature so it shouldn't matter (and this is clearly a typo from what I see).
| } | ||
|
|
||
| /* uplayer should read all */ | ||
| /* up layer should read all */ |
There was a problem hiding this comment.
I'm guessing. I couldn't find any other instances and there wasn't much context...
| /* Note: we don't need to test the no-writes flag here and set this run_ctx flag, | ||
| * since only write commands can are deny-oom. */ | ||
| /* Note: we don't need to test the no-writes flag here when we set this run_ctx flag, | ||
| * since only write commands are deny-oom. */ |
There was a problem hiding this comment.
the can are part tripped a rule. It took me a while to be able to get some understanding of what this was trying to say. I'm not confident about my corrections here.
There was a problem hiding this comment.
I'm not sure the correct meaning is retained. I think the original is fine if you drop the final 'are' (i.e. "only write commands can deny-oom."
| # The general form is: | ||
| # | ||
| # S <sentinel-id> command arg arg arg ... | ||
| # S <sentinel-id> command arg arg ... arg |
There was a problem hiding this comment.
Another of the ... family
|
|
||
| create_aof_manifest $aof_dirpath $aof_manifest_file { | ||
| append_to_manifest "filx appendonly.aof.1.base.aof seq 1 type b\n" | ||
| append_to_manifest "file_ appendonly.aof.1.base.aof seq 1 type b\n" |
There was a problem hiding this comment.
I personally prefer to use _ to "corrupt" a word to show that bad input isn't tolerated as opposed to actively misspelling words. Because entities make too many accidental typos (as shown in the rest of this PR), it seems best to avoid using such things as the test model.
I didn't apply this to all instances (I can't remember which ones I skipped -- this PR took a couple of days to develop...), as with everything else, I'm happy to drop.
| create_aof $aof_dirpath $aof_file { | ||
| append_to_aof [formatCommand set foo hello] | ||
| append_to_aof [formatCommand bla foo hello] | ||
| append_to_aof [formatCommand blah foo hello] |
There was a problem hiding this comment.
as mentioned earlier, I'm changing all bla to blah.
If the code is trying to say "this thing is only a 3 letter item", then I'd suggest using something more like xyz, whereas I think here it's trying to mean "blah".
| test {FUNCTION - Create a library with wrong name format} { | ||
| catch { | ||
| r function load [get_function_code LUA {bad\0foramat} test {return 'hello1'}] | ||
| r function load [get_function_code LUA {bad\0format} test {return 'hello1'}] |
There was a problem hiding this comment.
I'm not sure what the goals are here, but I'm hoping the \0 is all that makes a bad+format. Notably, tests pass, so it's probably fine...
| r multi | ||
| r get xx | ||
| $r1 replicaof localhsot 0 | ||
| $r1 replicaof localhost_ 0 |
There was a problem hiding this comment.
I can't tell if this was trying to write localhost and misspelled it, or trying not to write localhost.
I added a _ as noted earlier to say "I think they're trying not to write localhost". But it's possible it should just be localhost.
57b13b5 to
699c70e
Compare
|
#2183 (comment) is just adding |
stockholmux
left a comment
There was a problem hiding this comment.
There are quite a few excellent catches in this PR.
A few notes:
-
There are quite a few places where response to a user was altered. I don't think we'd do this because it could potentially break a user. I think I've marked all of them, but it's a big PR, I could have missed one. I noticed they were often around the use of the term "out of bounds" vs "out-of-bounds", so this change doesn't add much value.
-
Related to the first point: many of the tests are trying to match character-by-character the error messages, so those would also not change if we don't change the original error message.
-
A few changes were made to generated files which are marked "do not edit" on line 1.
Finally, with a PR this size I think the potential for merge conflicts are pretty big. I'm torn because some of the changes do add a lot of value and clarity, but do have to be very careful around any breaking changes that this PR might unintentionally create for Valkey users.
| void setbitCommand(client *c) { | ||
| robj *o; | ||
| char *err = "bit is not an integer or out of range"; | ||
| char *err = "bit is not an integer or out-of-range"; |
There was a problem hiding this comment.
This is an error surfaced to users; it's a slightly bigger deal to change than spelling/grammar that is constrained to the source code.. I hope this isn't the case but it's possible a user is matching the exact error message in their code.
I'm unsure if the project leadership has a thought about changes like this. I'm curious what others think.
| "Cluster communication port is 10,000 port " | ||
| "numbers higher than your %s port. " | ||
| "Cluster communication port is 10,000 ports " | ||
| "above your %s port. " |
There was a problem hiding this comment.
This feels like it has a slightly different meaning than the original. '10,000 port numbers' feels more clear.
|
|
||
| if (getLongLongFromObject(o, &slot) != C_OK || slot < 0 || slot >= CLUSTER_SLOTS) { | ||
| addReplyError(c, "Invalid or out of range slot"); | ||
| addReplyError(c, "Invalid or out-of-range slot"); |
There was a problem hiding this comment.
This is a user error message, so we should avoid changing it in case anyone has taken a character-by-character dependency on it.
| } | ||
| if (port <= 0 || port > 65535) { | ||
| addReplyErrorFormat(c, "Port number is out of range"); | ||
| addReplyErrorFormat(c, "Port number is out-of-range"); |
There was a problem hiding this comment.
This is a user error message, so we should avoid changing it in case anyone has taken a character-by-character dependency on it.
|
|
||
| if (cport <= 0 || cport > 65535) { | ||
| addReplyErrorFormat(c, "Cluster bus port number is out of range"); | ||
| addReplyErrorFormat(c, "Cluster bus port number is out-of-range"); |
There was a problem hiding this comment.
This is a user error message, so we should avoid changing it in case anyone has taken a character-by-character dependency on it.
| assert_error "*out of range*" {r setbit mykey 0 2} | ||
| assert_error "*out of range*" {r setbit mykey 0 10} | ||
| assert_error "*out of range*" {r setbit mykey 0 20} | ||
| assert_error "*out-of-range*" {r setbit mykey 0 -1} |
There was a problem hiding this comment.
related to an error message we wouldn't change.
|
|
||
| r set mykey "hello" | ||
| assert_error "*out of range*" {r setrange mykey -1 world} | ||
| assert_error "*out-of-range*" {r setrange mykey -1 world} |
There was a problem hiding this comment.
related to an error message we wouldn't change.
| catch {[r setrange K $value A]} res | ||
| # expecting a different error on 32 and 64 bit systems | ||
| if {![string match "*string exceeds maximum allowed size*" $res] && ![string match "*out of range*" $res]} { | ||
| if {![string match "*string exceeds maximum allowed size*" $res] && ![string match "*out-of-range*" $res]} { |
There was a problem hiding this comment.
related to an error message we wouldn't change.
| assert_error {*value is out of range*} {r zrandmember myzset -9223372036854770000 withscores} | ||
| assert_error {*value is out of range*} {r zrandmember myzset -9223372036854775808 withscores} | ||
| assert_error {*value is out of range*} {r zrandmember myzset -9223372036854775808} | ||
| assert_error {*value is out-of-range*} {r zrandmember myzset -9223372036854770000 withscores} |
There was a problem hiding this comment.
we wouldn't change the error message, so we wouldn't change the assertion
| # of mstime(). (decimal value equals to 0x7FFFFFFFFFFFFFFF) | ||
| assert_error "*timeout is out of range*" {$master wait 2 9223372036854775807} | ||
| # of mstime(). (decimal value equals 0x7FFFFFFFFFFFFFFF) | ||
| assert_error "*timeout is out-of-range*" {$master wait 2 9223372036854775807} |
There was a problem hiding this comment.
related to an error message we wouldn't change.
|
I have several suggestions for this PR (as what @stockholmux said)
Thanks a lot |
Signed-off-by: Josh Soref <[email protected]>
Signed-off-by: Josh Soref <[email protected]>
Signed-off-by: Josh Soref <[email protected]>
Signed-off-by: Josh Soref <[email protected]>
Signed-off-by: Josh Soref <[email protected]>
Signed-off-by: Josh Soref <[email protected]>
Signed-off-by: Josh Soref <[email protected]>
Signed-off-by: Josh Soref <[email protected]>
Signed-off-by: Josh Soref <[email protected]>
Signed-off-by: Josh Soref <[email protected]>
Signed-off-by: Josh Soref <[email protected]>
Signed-off-by: Josh Soref <[email protected]>
Signed-off-by: Josh Soref <[email protected]>
Signed-off-by: Josh Soref <[email protected]>
Signed-off-by: Josh Soref <[email protected]>
Signed-off-by: Josh Soref <[email protected]>
|
This is mostly split. There are a handful of changes I've held off and a couple of the PRs do conflict with each other (this isn't terribly surprising), the rebases for them are trivial so whichever wins, I'll rebase the loser. |
- Subset of #2183 --------- Signed-off-by: Josh Soref <[email protected]>
- Subset of #2183 --------- Signed-off-by: Josh Soref <[email protected]>
|
Hey @jsoref, think we could close this in favor of the subset PRs? Do you want to do something about the bit you mentioned that wasn't split out? |
- Subset of #2183 --------- Signed-off-by: Josh Soref <[email protected]> Signed-off-by: Viktor Söderqvist <[email protected]> Co-authored-by: Viktor Söderqvist <[email protected]>
…d Tcl tests (#2243) Fix spelling and grammar issues across 17 files This is a subset of #2183. --------- Signed-off-by: Josh Soref <[email protected]> Co-authored-by: Sarthak Aggarwal <[email protected]>
|
Closing this PR since it's been split into multiple subset PRs, many of which have been merged now 🙂 |
- Subset of #2183 Signed-off-by: Josh Soref <[email protected]>
- Subset of #2183 Signed-off-by: Josh Soref <[email protected]>
…ts (#2252) - Subset of #2183 --------- Signed-off-by: Josh Soref <[email protected]>
- Subset of #2183 --------- Signed-off-by: Josh Soref <[email protected]>
- Subset of #2183 Signed-off-by: Josh Soref <[email protected]> Backport-Source-PR: 2238
- Subset of #2183 Signed-off-by: Josh Soref <[email protected]> Backport-Source-PR: 2238
- Subset of #2183 Signed-off-by: Josh Soref <[email protected]> Backport-Source-PR: 2242
…ts (#2252) - Subset of #2183 --------- Signed-off-by: Josh Soref <[email protected]> Backport-Source-PR: 2252
- Subset of #2183 --------- Signed-off-by: Josh Soref <[email protected]> Backport-Source-PR: 2241
- Subset of #2183 Signed-off-by: Josh Soref <[email protected]> Backport-Source-PR: 2242
…ts (#2252) - Subset of #2183 --------- Signed-off-by: Josh Soref <[email protected]> Backport-Source-PR: 2252
- Subset of #2183 --------- Signed-off-by: Josh Soref <[email protected]> Backport-Source-PR: 2241
This PR corrects misspellings identified by the check-spelling action
The misspellings have been reported at https://github.com/jsoref/valkey/actions/runs/15496041308/attempts/1#summary-43632891663
The action reports that the changes in this PR would make it mostly happy: https://github.com/jsoref/valkey/actions/runs/15496042495/attempts/1#summary-43632894710
I'll fix up the commits based on feedback -- typically for PRs like this (which by my standards is a medium size), projects have preferences about things being dropped or split.