Skip to content

Commit

Permalink
apply typos
Browse files Browse the repository at this point in the history
Signed-off-by: tison <[email protected]>
  • Loading branch information
tisonkun committed Aug 10, 2023
1 parent cefd06c commit c080dd7
Show file tree
Hide file tree
Showing 15 changed files with 56 additions and 26 deletions.
30 changes: 30 additions & 0 deletions .github/config/typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

[files]
extend-exclude = [
"src/common/sha1.cc",
"tests/gocase/util/slot.go",
]

[default.extend-words]
# keywords
"exat" = "exat"
"smove" = "smove"

# random strings
"ue" = "ue"
2 changes: 1 addition & 1 deletion .github/workflows/kvrocks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
- name: Install typos-cli
run: cargo install typos-cli
- name: Run typos check
run: typos
run: typos --config .github/config/typos.toml

check-and-lint:
name: Lint and check code
Expand Down
4 changes: 2 additions & 2 deletions kvrocks.conf
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ rocksdb.max_open_files 8096
# default is 64MB
rocksdb.write_buffer_size 64

# Target file size for compaction, target file size for Leve N can be calculated
# Target file size for compaction, target file size for Level N can be calculated
# by target_file_size_base * (target_file_size_multiplier ^ (L-1))
#
# Default: 128MB
Expand Down Expand Up @@ -802,7 +802,7 @@ rocksdb.write_options.sync no
# If yes, writes will not first go to the write ahead log,
# and the write may get lost after a crash.
#
# Deafult: no
# Default: no
rocksdb.write_options.disable_wal no

# If enabled and we need to wait or sleep for the write request, fails
Expand Down
2 changes: 1 addition & 1 deletion src/cluster/slot_import.cc
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ void SlotImport::StopForLinkError(int fd) {
// 2. Source server's migration process end after destination server has finished replication.
// 3. The migration link closed by source server, then this function will be call by OnEvent.
// 4. ClearKeysOfSlot can clear data although server is a slave, because ClearKeysOfSlot
// deletes data in rocksdb directly. Therefor, it is necessary to avoid clearing data gotten
// deletes data in rocksdb directly. Therefore, it is necessary to avoid clearing data gotten
// from new master.
if (!svr_->IsSlave()) {
// Clean imported slot data
Expand Down
2 changes: 1 addition & 1 deletion src/cluster/slot_migrate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ Status SlotMigrator::sendSnapshot() {
}

LOG(INFO) << "[migrate] Succeed to migrate slot snapshot, slot: " << slot << ", Migrated keys: " << migrated_key_cnt
<< ", Expired keys: " << expired_key_cnt << ", Emtpy keys: " << empty_key_cnt;
<< ", Expired keys: " << expired_key_cnt << ", Empty keys: " << empty_key_cnt;

return Status::OK();
}
Expand Down
4 changes: 2 additions & 2 deletions src/commands/cmd_cluster.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class CommandCluster : public Commander {
}

if (!conn->IsAdmin()) {
return {Status::RedisExecErr, errAdministorPermissionRequired};
return {Status::RedisExecErr, errAdminPermissionRequired};
}

if (subcommand_ == "keyslot") {
Expand Down Expand Up @@ -216,7 +216,7 @@ class CommandClusterX : public Commander {
}

if (!conn->IsAdmin()) {
return {Status::RedisExecErr, errAdministorPermissionRequired};
return {Status::RedisExecErr, errAdminPermissionRequired};
}

bool need_persist_nodes_info = false;
Expand Down
14 changes: 7 additions & 7 deletions src/commands/cmd_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class CommandNamespace : public Commander {
public:
Status Execute(Server *svr, Connection *conn, std::string *output) override {
if (!conn->IsAdmin()) {
return {Status::RedisExecErr, errAdministorPermissionRequired};
return {Status::RedisExecErr, errAdminPermissionRequired};
}

Config *config = svr->GetConfig();
Expand Down Expand Up @@ -173,7 +173,7 @@ class CommandFlushAll : public Commander {
public:
Status Execute(Server *svr, Connection *conn, std::string *output) override {
if (!conn->IsAdmin()) {
return {Status::RedisExecErr, errAdministorPermissionRequired};
return {Status::RedisExecErr, errAdminPermissionRequired};
}

if (svr->GetConfig()->cluster_enabled) {
Expand Down Expand Up @@ -221,7 +221,7 @@ class CommandConfig : public Commander {
public:
Status Execute(Server *svr, Connection *conn, std::string *output) override {
if (!conn->IsAdmin()) {
return {Status::RedisExecErr, errAdministorPermissionRequired};
return {Status::RedisExecErr, errAdminPermissionRequired};
}

Config *config = svr->GetConfig();
Expand Down Expand Up @@ -547,7 +547,7 @@ class CommandShutdown : public Commander {
public:
Status Execute(Server *srv, Connection *conn, std::string *output) override {
if (!conn->IsAdmin()) {
return {Status::RedisExecErr, errAdministorPermissionRequired};
return {Status::RedisExecErr, errAdminPermissionRequired};
}

if (!srv->IsStopped()) {
Expand Down Expand Up @@ -842,7 +842,7 @@ class CommandBGSave : public Commander {
public:
Status Execute(Server *svr, Connection *conn, std::string *output) override {
if (!conn->IsAdmin()) {
return {Status::RedisExecErr, errAdministorPermissionRequired};
return {Status::RedisExecErr, errAdminPermissionRequired};
}

Status s = svr->AsyncBgSaveDB();
Expand All @@ -858,7 +858,7 @@ class CommandFlushBackup : public Commander {
public:
Status Execute(Server *svr, Connection *conn, std::string *output) override {
if (!conn->IsAdmin()) {
return {Status::RedisExecErr, errAdministorPermissionRequired};
return {Status::RedisExecErr, errAdminPermissionRequired};
}

Status s = svr->AsyncPurgeOldBackups(0, 0);
Expand Down Expand Up @@ -917,7 +917,7 @@ class CommandSlaveOf : public Commander {
}

if (!conn->IsAdmin()) {
return {Status::RedisExecErr, errAdministorPermissionRequired};
return {Status::RedisExecErr, errAdminPermissionRequired};
}

if (host_.empty()) {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/commander.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ struct CommandAttributes {
// negative number -n means number of arguments is equal to or large than n
int arity;

// space-splitted flag strings to initialize flags
// space-sparated flag strings to initialize flags
std::string description;

// bitmap of enum CommandFlags
Expand Down
2 changes: 1 addition & 1 deletion src/commands/error_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ inline constexpr const char *errInvalidSyntax = "syntax error";
inline constexpr const char *errInvalidExpireTime = "invalid expire time";
inline constexpr const char *errWrongNumOfArguments = "wrong number of arguments";
inline constexpr const char *errValueNotInteger = "value is not an integer or out of range";
inline constexpr const char *errAdministorPermissionRequired = "administor permission required to perform the command";
inline constexpr const char *errAdminPermissionRequired = "admin permission required to perform the command";
inline constexpr const char *errValueMustBePositive = "value is out of range, must be positive";
inline constexpr const char *errNoSuchKey = "no such key";
inline constexpr const char *errUnbalancedStreamList =
Expand Down
4 changes: 2 additions & 2 deletions src/types/geohash.cc
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ uint8_t GeoHashHelper::EstimateStepsByRadius(double range_meters, double lat) {
}
step -= 2; /* Make sure range is included in most of the base cases. */

/* Wider range torwards the poles... Note: it is possible to do better
/* Wider range towards the poles... Note: it is possible to do better
* than this approximation by computing the distance between meridians
* at this latitude, but this does the trick for now. */
if (lat > 66 || lat < -66) {
Expand All @@ -328,7 +328,7 @@ uint8_t GeoHashHelper::EstimateStepsByRadius(double range_meters, double lat) {

/* Return the bounding box of the search area centered at latitude,longitude
* having a radius of radius_meter. bounds[0] - bounds[2] is the minimum
* and maxium longitude, while bounds[1] - bounds[3] is the minimum and
* and maximum longitude, while bounds[1] - bounds[3] is the minimum and
* maximum latitude. */
int GeoHashHelper::BoundingBox(GeoShape *geo_shape) {
if (!geo_shape->bounds) return 0;
Expand Down
2 changes: 1 addition & 1 deletion src/types/redis_geo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ void Geo::scoresOfGeoHashBox(GeoHashBits hash, GeoHashFix52Bits *min, GeoHashFix
* 'max', appending them into the array of GeoPoint structures 'gparray'.
* The command returns the number of elements added to the array.
*
* Elements which are farest than 'radius' from the specified 'x' and 'y'
* Elements which are farthest than 'radius' from the specified 'x' and 'y'
* coordinates are not included.
*
* The ability of this function to append to an existing set of points is
Expand Down
2 changes: 1 addition & 1 deletion tests/cppunit/metadata_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ TEST(InternalKey, EncodeAndDecode) {
EXPECT_EQ(ikey, ikey1);
}

TEST(Metadata, EncodeAndDeocde) {
TEST(Metadata, EncodeAndDecode) {
std::string string_bytes;
Metadata string_md(kRedisString);
string_md.expire = 123000;
Expand Down
2 changes: 1 addition & 1 deletion tests/cppunit/types/hash_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ TEST_F(RedisHashTest, HRangeByLex) {
EXPECT_EQ("key1", result[0].field);
EXPECT_EQ("key2", result[1].field);

// inf and revered
// inf and reversed
spec.minex = false;
spec.maxex = false;
spec.min = "-";
Expand Down
8 changes: 4 additions & 4 deletions tests/cppunit/types/stream_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ TEST_F(RedisStreamTest, RangeWithStartAndEndAreEqual) {
CheckStreamEntryValues(entries[0].values, values2);
}

TEST_F(RedisStreamTest, RangeWithStartAndEndAreEqualAndExludedStart) {
TEST_F(RedisStreamTest, RangeWithStartAndEndAreEqualAndExcludedStart) {
redis::StreamAddOptions add_options;
add_options.next_id_strategy = *ParseNextStreamEntryIDStrategy(fmt::format("{}-{}", 123456, 1));
std::vector<std::string> values1 = {"key1", "val1"};
Expand All @@ -741,7 +741,7 @@ TEST_F(RedisStreamTest, RangeWithStartAndEndAreEqualAndExludedStart) {
EXPECT_EQ(entries.size(), 0);
}

TEST_F(RedisStreamTest, RangeWithStartAndEndAreEqualAndExludedEnd) {
TEST_F(RedisStreamTest, RangeWithStartAndEndAreEqualAndExcludedEnd) {
redis::StreamAddOptions add_options;
add_options.next_id_strategy = *ParseNextStreamEntryIDStrategy(fmt::format("{}-{}", 123456, 1));
std::vector<std::string> values1 = {"key1", "val1"};
Expand Down Expand Up @@ -876,7 +876,7 @@ TEST_F(RedisStreamTest, RangeWithExcludedStartAndExcludedEnd) {
CheckStreamEntryValues(entries[1].values, values3);
}

TEST_F(RedisStreamTest, RangeWithStartAsMaximumAndExlusion) {
TEST_F(RedisStreamTest, RangeWithStartAsMaximumAndExclusion) {
redis::StreamAddOptions add_options;
add_options.next_id_strategy = *ParseNextStreamEntryIDStrategy(fmt::format("{}-{}", 123456, 1));
std::vector<std::string> values1 = {"key1", "val1"};
Expand All @@ -893,7 +893,7 @@ TEST_F(RedisStreamTest, RangeWithStartAsMaximumAndExlusion) {
EXPECT_TRUE(!s.ok());
}

TEST_F(RedisStreamTest, RangeWithEndAsMinimumAndExlusion) {
TEST_F(RedisStreamTest, RangeWithEndAsMinimumAndExclusion) {
redis::StreamAddOptions add_options;
add_options.next_id_strategy = *ParseNextStreamEntryIDStrategy(fmt::format("{}-{}", 123456, 1));
std::vector<std::string> values1 = {"key1", "val1"};
Expand Down
2 changes: 1 addition & 1 deletion tests/gocase/unit/multi/multi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func TestMulti(t *testing.T) {
rdb := srv.NewClient()
defer func() { require.NoError(t, rdb.Close()) }()

t.Run("MUTLI / EXEC basics", func(t *testing.T) {
t.Run("MULTI / EXEC basics", func(t *testing.T) {
require.NoError(t, rdb.Del(ctx, "mylist").Err())
require.NoError(t, rdb.RPush(ctx, "mylist", "a").Err())
require.NoError(t, rdb.RPush(ctx, "mylist", "b").Err())
Expand Down

0 comments on commit c080dd7

Please sign in to comment.