This is an automated email from the ASF dual-hosted git repository.
aaronai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-clients.git
The following commit(s) were added to refs/heads/master by this push:
new 0a0e2318 Replace misspell by CodeSpell (#445)
0a0e2318 is described below
commit 0a0e2318c98c762257fdf4be7845c6d348741c5c
Author: Aaron Ai <[email protected]>
AuthorDate: Sun Apr 2 10:07:59 2023 +0800
Replace misspell by CodeSpell (#445)
* Replace misspell by CodeSpell
* Fix typo
* Fix typo
* Remove redundant ignore works
* Remove misspell from required_status_checks
* Polish code
---
.asf.yaml | 3 +--
.github/workflows/codespell_check.yaml | 25 ++++++++++++++++++++++
.../{misspell_check.yaml => mispell_check.yaml} | 2 +-
.github/workflows/php_build.yml | 2 +-
cpp/include/rocketmq/ErrorCode.h | 2 +-
cpp/proto/apache/rocketmq/v2/service.proto | 4 ++--
cpp/source/base/UtilAll.cpp | 2 +-
docs/design.md | 12 +++++------
docs/workflow.md | 6 +++---
golang/example/producer/async/main.go | 2 +-
golang/example/producer/fifo/main.go | 2 +-
golang/example/producer/transaction/main.go | 2 +-
golang/metric.go | 8 +++----
golang/simple_consumer_options.go | 4 ++--
golang/transaction.go | 2 +-
php/grpc/Apache/Rocketmq/V2/Settings.php | 8 +++----
php/grpc/Apache/Rocketmq/V2/Subscription.php | 8 +++----
php/protocol/apache/rocketmq/v2/service.proto | 4 ++--
rust/proto/apache/rocketmq/v2/service.proto | 4 ++--
style/codespell/exclude_file.txt | 5 +++++
style/codespell/ignore_words.txt | 4 ++++
21 files changed, 72 insertions(+), 39 deletions(-)
diff --git a/.asf.yaml b/.asf.yaml
index 36c3d3e5..bcf6e67c 100644
--- a/.asf.yaml
+++ b/.asf.yaml
@@ -40,8 +40,7 @@ github:
master:
required_status_checks:
contexts:
- - misspell-check
- - check-license
+ - codespell-check
- build-result
notifications:
commits: [email protected]
diff --git a/.github/workflows/codespell_check.yaml
b/.github/workflows/codespell_check.yaml
new file mode 100644
index 00000000..1bfe6e3a
--- /dev/null
+++ b/.github/workflows/codespell_check.yaml
@@ -0,0 +1,25 @@
+name: CodeSpell Check
+
+on:
+ pull_request:
+ types: [opened, reopened, synchronize]
+ push:
+ branches:
+ - master
+
+jobs:
+ codespell-check:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v2
+
+ - name: Install CodeSpell
+ run: pip install codespell
+
+ - name: Run CodeSpell
+ run: |
+ codespell --quiet-level=2 \
+ --skip
"./cpp/third_party,./style/codespell/ignore_words.txt,./.git" \
+ --ignore-words ./style/codespell/ignore_words.txt \
+ --exclude-file ./style/codespell/exclude_file.txt \
\ No newline at end of file
diff --git a/.github/workflows/misspell_check.yaml
b/.github/workflows/mispell_check.yaml
similarity index 93%
rename from .github/workflows/misspell_check.yaml
rename to .github/workflows/mispell_check.yaml
index 77411aca..1512bcdd 100644
--- a/.github/workflows/misspell_check.yaml
+++ b/.github/workflows/mispell_check.yaml
@@ -15,4 +15,4 @@ jobs:
curl -L -o ./install-misspell.sh https://git.io/misspell
sh ./install-misspell.sh
- name: Run misspell
- run: find . ! -path "./cpp/third_party/*" -type f -print0 | xargs -0
bin/misspell -error
+ run: find . ! -path "./cpp/third_party/*" -type f -print0 | xargs -0
bin/misspell -error
\ No newline at end of file
diff --git a/.github/workflows/php_build.yml b/.github/workflows/php_build.yml
index e4a774c8..f532a052 100644
--- a/.github/workflows/php_build.yml
+++ b/.github/workflows/php_build.yml
@@ -19,6 +19,6 @@ jobs:
- name: Validate composer.json
working-directory: ./php
run: composer validate
- - name: Install Dependecies
+ - name: Install Dependencies
working-directory: ./php
run: composer install
diff --git a/cpp/include/rocketmq/ErrorCode.h b/cpp/include/rocketmq/ErrorCode.h
index 4f05dedd..51784e16 100644
--- a/cpp/include/rocketmq/ErrorCode.h
+++ b/cpp/include/rocketmq/ErrorCode.h
@@ -153,7 +153,7 @@ enum class ErrorCode : int {
PreconditionRequired = 42800,
/**
- * @brief Quota exchausted. The user has sent too many requests in a given
+ * @brief Quota exhausted. The user has sent too many requests in a given
* amount of time.
*
*/
diff --git a/cpp/proto/apache/rocketmq/v2/service.proto
b/cpp/proto/apache/rocketmq/v2/service.proto
index 42bf3326..16c0d527 100644
--- a/cpp/proto/apache/rocketmq/v2/service.proto
+++ b/cpp/proto/apache/rocketmq/v2/service.proto
@@ -227,7 +227,7 @@ message Subscription {
// When FIFO flag is `true`, messages of the same message group are processed
// in first-in-first-out manner.
//
- // Brokers will not deliver further messages of the same group utill prior
+ // Brokers will not deliver further messages of the same group until prior
// ones are completely acknowledged.
optional bool fifo = 3;
@@ -261,7 +261,7 @@ message Settings {
// after which the message should be available to consume again.
//
// For FIFO messages, the interval should be relatively small because
- // messages of the same message group would not be readily available utill
+ // messages of the same message group would not be readily available until
// the prior one depletes its lifecycle.
optional RetryPolicy backoff_policy = 3;
diff --git a/cpp/source/base/UtilAll.cpp b/cpp/source/base/UtilAll.cpp
index fc04559e..939121b4 100644
--- a/cpp/source/base/UtilAll.cpp
+++ b/cpp/source/base/UtilAll.cpp
@@ -101,7 +101,7 @@ bool UtilAll::macAddress(std::vector<unsigned char>& mac) {
char mac_address[18];
adaptor_info = (IP_ADAPTER_INFO*)malloc(buf_len);
if (!adaptor_info) {
- // TODO: running out of memroy
+ // TODO: running out of memory
}
if (GetAdaptersInfo(adaptor_info, &buf_len) == NO_ERROR) {
diff --git a/docs/design.md b/docs/design.md
index 5380b00a..ea67e6ab 100644
--- a/docs/design.md
+++ b/docs/design.md
@@ -1,6 +1,6 @@
# Design
-This project aims to build lightweight, cloud-native clients, and establish
the unified messaging model/APIs design acorss languages.
+This project aims to build lightweight, cloud-native clients, and establish
the unified messaging model/APIs design across languages.
## Messaging Model
@@ -29,7 +29,7 @@ As we all know, consumer group is the basic unit of load
balancing for consumers
* FIFO consumption switch: enable/disable FIFO consumption for FIFO messages.
* Message consumption retry policy: decide the max delivery times and backoff
algorithm for the message which is failed to be consumed in push consumer.
-Especially, this table shows the sequence of message receiption with the
combination of FIFO/non-FIFO topics and FIFO/non-FIFO consumer groups.
+Especially, this table shows the sequence of message reception with the
combination of FIFO/non-FIFO topics and FIFO/non-FIFO consumer groups.
<div align="center">
@@ -51,7 +51,7 @@ There are four types of client.
### Client Identifier
-Client identifier provides indentity information for each client event within
the same process. A typical client identifier: `macbook-pro@90009@0@2dyeb8lep`,
which could be divided into 4 parts by the separator `@`.
+Client identifier provides identity information for each client event within
the same process. A typical client identifier: `macbook-pro@90009@0@2dyeb8lep`,
which could be divided into 4 parts by the separator `@`.
* `macbook-pro`: hostname of device;
* `90009`: process identifier;
@@ -62,11 +62,11 @@ Client identifier provides indentity information for each
client event within th
### Message Identifier
-Message identifer provides identity information for each message stored in
broker, which means producer can not get the message identifier until it is
sent out successfully.
+Message identifier provides identity information for each message stored in
broker, which means producer can not get the message identifier until it is
sent out successfully.
->**Note**: Internal retries during message publishing may cause message
duplication, the duplicate messages here have the same message indentifier.
+>**Note**: Internal retries during message publishing may cause message
duplication, the duplicate messages here have the same message identifier.
-The message identifer layout is redesigned, see more details
[here](./message_id.md).
+The message identifier layout is redesigned, see more details
[here](./message_id.md).
## New and Unified APIs
diff --git a/docs/workflow.md b/docs/workflow.md
index b76983ed..5fb6b5a8 100644
--- a/docs/workflow.md
+++ b/docs/workflow.md
@@ -52,9 +52,9 @@ The publishing procedure is as follows:
11. Isolate the current endpoint for publishing.
12. Rotate to next message queue to publish message, and go to step 6.
-> **Note**: The failure of message publishing will isolate the endpoint, this
makes the endpoint will not be selected for load balancing as much as possible.
The periodic heartbeat to the isolate endpoint will check health status about
it and remove it from the isolate endpoints if no more exception is deteched.
+> **Note**: The failure of message publishing will isolate the endpoint, this
makes the endpoint will not be selected for load balancing as much as possible.
The periodic heartbeat to the isolate endpoint will check health status about
it and remove it from the isolate endpoints if no more exception is detected.
-For TRANSACTIONAL messages, the publishing will not be retried if failure is
encountered. The ordering of FIFO message is based on the assumption that
messages which have the same `message group` will be put into the same message
queue, thus the message queue to publish is not disturbed by the isolated
enpoint([SipHash](https://en.wikipedia.org/wiki/SipHash) algorithm is used to
calculate the message queue index for FIFO message publishing).
+For TRANSACTIONAL messages, the publishing will not be retried if failure is
encountered. The ordering of FIFO message is based on the assumption that
messages which have the same `message group` will be put into the same message
queue, thus the message queue to publish is not disturbed by the isolated
endpoint([SipHash](https://en.wikipedia.org/wiki/SipHash) algorithm is used to
calculate the message queue index for FIFO message publishing).
About the message publishing retry policy when failure is encountered, in
order to ensure the timeliness of message publishing, the next attempt would be
executed immediately in most case if flow control does not encountered.
Actually the server would deliver the explicit retry policy flow control for
each producer while publishing flow control occurs.
@@ -74,7 +74,7 @@ The receiving procedure is as follows:
1. Fetch the latest queue assignment from server.
2. If flow control occurs during message receiving, consumer will retry after
20 milliseconds, otherwise go to step3.
-3. Cache message and trigger the consumption(Once the lifecycle of message is
over, it will removed from cache immmediately).
+3. Cache message and trigger the consumption(Once the lifecycle of message is
over, it will removed from cache immediately).
4. Check the cache is full, consumer will try to receive message immediately,
otherwise retry after 1 seconds.
### Message Consumption in Push Consumer(Non-FIFO)
diff --git a/golang/example/producer/async/main.go
b/golang/example/producer/async/main.go
index 543c9b24..caf54b0e 100644
--- a/golang/example/producer/async/main.go
+++ b/golang/example/producer/async/main.go
@@ -40,7 +40,7 @@ func main() {
// log to console
os.Setenv("mq.consoleAppender.enabled", "true")
rmq_client.ResetLogger()
- // In mose case, you don't need to create many producers, singletion
pattern is more recommended.
+ // In most case, you don't need to create many producers, singletion
pattern is more recommended.
producer, err := rmq_client.NewProducer(&rmq_client.Config{
Endpoint: Endpoint,
Credentials: &credentials.SessionCredentials{
diff --git a/golang/example/producer/fifo/main.go
b/golang/example/producer/fifo/main.go
index 665842f0..17173858 100644
--- a/golang/example/producer/fifo/main.go
+++ b/golang/example/producer/fifo/main.go
@@ -40,7 +40,7 @@ func main() {
// log to console
os.Setenv("mq.consoleAppender.enabled", "true")
rmq_client.ResetLogger()
- // In mose case, you don't need to create many producers, singletion
pattern is more recommended.
+ // In most case, you don't need to create many producers, singletion
pattern is more recommended.
producer, err := rmq_client.NewProducer(&rmq_client.Config{
Endpoint: Endpoint,
Credentials: &credentials.SessionCredentials{
diff --git a/golang/example/producer/transaction/main.go
b/golang/example/producer/transaction/main.go
index af498114..fc7bacc7 100644
--- a/golang/example/producer/transaction/main.go
+++ b/golang/example/producer/transaction/main.go
@@ -40,7 +40,7 @@ func main() {
// log to console
os.Setenv("mq.consoleAppender.enabled", "true")
rmq_client.ResetLogger()
- // In mose case, you don't need to create many producers, singletion
pattern is more recommended.
+ // In most case, you don't need to create many producers, singletion
pattern is more recommended.
producer, err := rmq_client.NewProducer(&rmq_client.Config{
Endpoint: Endpoint,
Credentials: &credentials.SessionCredentials{
diff --git a/golang/metric.go b/golang/metric.go
index e7f4a156..4213c6f2 100644
--- a/golang/metric.go
+++ b/golang/metric.go
@@ -79,9 +79,9 @@ func (dcm *defaultClientMeter) shutdown() {
defer dcm.mutex.Unlock()
view.UnregisterExporter(dcm.ocaExporter)
if dcm.ocaExporter != nil {
- oce, ok := dcm.ocaExporter.(*ocagent.Exporter)
+ exporter, ok := dcm.ocaExporter.(*ocagent.Exporter)
if ok {
- err := oce.Stop()
+ err := exporter.Stop()
if err != nil {
sugarBaseLogger.Errorf("ocExporter stop failed,
err=%w", err)
}
@@ -186,7 +186,7 @@ func (dcmp *defaultClientMeterProvider) Reset(metric
*v2.Metric) {
return
}
agentAddr := utils.ParseAddress(utils.SelectAnAddress(endpoints))
- oce, err := ocagent.NewExporter(
+ exporter, err := ocagent.NewExporter(
ocagent.WithInsecure(),
ocagent.WithTLSCredentials(credentials.NewTLS(defaultConnOptions.TLS)),
ocagent.WithAddress(agentAddr),
@@ -198,7 +198,7 @@ func (dcmp *defaultClientMeterProvider) Reset(metric
*v2.Metric) {
}
// Reset message meter.
dcmp.clientMeter.shutdown()
- dcmp.clientMeter = NewDefaultClientMeter(oce, true, endpoints,
dcmp.client.GetClientID())
+ dcmp.clientMeter = NewDefaultClientMeter(exporter, true, endpoints,
dcmp.client.GetClientID())
dcmp.clientMeter.start()
sugarBaseLogger.Infof("metrics is on, endpoints=%v, clientId=%s",
endpoints, dcmp.client.GetClientID())
}
diff --git a/golang/simple_consumer_options.go
b/golang/simple_consumer_options.go
index 09ad1d7e..857a4191 100644
--- a/golang/simple_consumer_options.go
+++ b/golang/simple_consumer_options.go
@@ -75,8 +75,8 @@ type funcSimpleConsumerOption struct {
f func(*simpleConsumerOptions)
}
-func (fo *funcSimpleConsumerOption) apply(do *simpleConsumerOptions) {
- fo.f(do)
+func (option *funcSimpleConsumerOption) apply(do *simpleConsumerOptions) {
+ option.f(do)
}
func newFuncSimpleConsumerOption(f func(*simpleConsumerOptions))
*funcSimpleConsumerOption {
diff --git a/golang/transaction.go b/golang/transaction.go
index 51b434cb..f6741101 100644
--- a/golang/transaction.go
+++ b/golang/transaction.go
@@ -26,7 +26,7 @@ import (
type TransactionResolution int32
const (
- UNKNOW TransactionResolution = iota // 开始生成枚举值, 默认为0
+ UNKNOWN TransactionResolution = iota // 开始生成枚举值, 默认为0
COMMIT
ROLLBACK
)
diff --git a/php/grpc/Apache/Rocketmq/V2/Settings.php
b/php/grpc/Apache/Rocketmq/V2/Settings.php
index 58622750..afd1b8f8 100644
--- a/php/grpc/Apache/Rocketmq/V2/Settings.php
+++ b/php/grpc/Apache/Rocketmq/V2/Settings.php
@@ -30,7 +30,7 @@ class Settings extends \Google\Protobuf\Internal\Message
* When processing message fails, `backoff_policy` describes an interval
* after which the message should be available to consume again.
* For FIFO messages, the interval should be relatively small because
- * messages of the same message group would not be readily available utill
+ * messages of the same message group would not be readily available until
* the prior one depletes its lifecycle.
*
* Generated from protobuf field <code>optional
.apache.rocketmq.v2.RetryPolicy backoff_policy = 3;</code>
@@ -70,7 +70,7 @@ class Settings extends \Google\Protobuf\Internal\Message
* When processing message fails, `backoff_policy` describes an
interval
* after which the message should be available to consume again.
* For FIFO messages, the interval should be relatively small
because
- * messages of the same message group would not be readily
available utill
+ * messages of the same message group would not be readily
available until
* the prior one depletes its lifecycle.
* @type \Google\Protobuf\Duration $request_timeout
* Request timeout for RPCs excluding long-polling.
@@ -161,7 +161,7 @@ class Settings extends \Google\Protobuf\Internal\Message
* When processing message fails, `backoff_policy` describes an interval
* after which the message should be available to consume again.
* For FIFO messages, the interval should be relatively small because
- * messages of the same message group would not be readily available utill
+ * messages of the same message group would not be readily available until
* the prior one depletes its lifecycle.
*
* Generated from protobuf field <code>optional
.apache.rocketmq.v2.RetryPolicy backoff_policy = 3;</code>
@@ -189,7 +189,7 @@ class Settings extends \Google\Protobuf\Internal\Message
* When processing message fails, `backoff_policy` describes an interval
* after which the message should be available to consume again.
* For FIFO messages, the interval should be relatively small because
- * messages of the same message group would not be readily available utill
+ * messages of the same message group would not be readily available until
* the prior one depletes its lifecycle.
*
* Generated from protobuf field <code>optional
.apache.rocketmq.v2.RetryPolicy backoff_policy = 3;</code>
diff --git a/php/grpc/Apache/Rocketmq/V2/Subscription.php
b/php/grpc/Apache/Rocketmq/V2/Subscription.php
index 67b4fa60..33f03418 100644
--- a/php/grpc/Apache/Rocketmq/V2/Subscription.php
+++ b/php/grpc/Apache/Rocketmq/V2/Subscription.php
@@ -32,7 +32,7 @@ class Subscription extends \Google\Protobuf\Internal\Message
* server to push.
* When FIFO flag is `true`, messages of the same message group are
processed
* in first-in-first-out manner.
- * Brokers will not deliver further messages of the same group utill prior
+ * Brokers will not deliver further messages of the same group until prior
* ones are completely acknowledged.
*
* Generated from protobuf field <code>optional bool fifo = 3;</code>
@@ -69,7 +69,7 @@ class Subscription extends \Google\Protobuf\Internal\Message
* server to push.
* When FIFO flag is `true`, messages of the same message group
are processed
* in first-in-first-out manner.
- * Brokers will not deliver further messages of the same group
utill prior
+ * Brokers will not deliver further messages of the same group
until prior
* ones are completely acknowledged.
* @type int $receive_batch_size
* Message receive batch size here is essential for push
consumer.
@@ -154,7 +154,7 @@ class Subscription extends \Google\Protobuf\Internal\Message
* server to push.
* When FIFO flag is `true`, messages of the same message group are
processed
* in first-in-first-out manner.
- * Brokers will not deliver further messages of the same group utill prior
+ * Brokers will not deliver further messages of the same group until prior
* ones are completely acknowledged.
*
* Generated from protobuf field <code>optional bool fifo = 3;</code>
@@ -180,7 +180,7 @@ class Subscription extends \Google\Protobuf\Internal\Message
* server to push.
* When FIFO flag is `true`, messages of the same message group are
processed
* in first-in-first-out manner.
- * Brokers will not deliver further messages of the same group utill prior
+ * Brokers will not deliver further messages of the same group until prior
* ones are completely acknowledged.
*
* Generated from protobuf field <code>optional bool fifo = 3;</code>
diff --git a/php/protocol/apache/rocketmq/v2/service.proto
b/php/protocol/apache/rocketmq/v2/service.proto
index 42bf3326..16c0d527 100644
--- a/php/protocol/apache/rocketmq/v2/service.proto
+++ b/php/protocol/apache/rocketmq/v2/service.proto
@@ -227,7 +227,7 @@ message Subscription {
// When FIFO flag is `true`, messages of the same message group are processed
// in first-in-first-out manner.
//
- // Brokers will not deliver further messages of the same group utill prior
+ // Brokers will not deliver further messages of the same group until prior
// ones are completely acknowledged.
optional bool fifo = 3;
@@ -261,7 +261,7 @@ message Settings {
// after which the message should be available to consume again.
//
// For FIFO messages, the interval should be relatively small because
- // messages of the same message group would not be readily available utill
+ // messages of the same message group would not be readily available until
// the prior one depletes its lifecycle.
optional RetryPolicy backoff_policy = 3;
diff --git a/rust/proto/apache/rocketmq/v2/service.proto
b/rust/proto/apache/rocketmq/v2/service.proto
index 42bf3326..16c0d527 100644
--- a/rust/proto/apache/rocketmq/v2/service.proto
+++ b/rust/proto/apache/rocketmq/v2/service.proto
@@ -227,7 +227,7 @@ message Subscription {
// When FIFO flag is `true`, messages of the same message group are processed
// in first-in-first-out manner.
//
- // Brokers will not deliver further messages of the same group utill prior
+ // Brokers will not deliver further messages of the same group until prior
// ones are completely acknowledged.
optional bool fifo = 3;
@@ -261,7 +261,7 @@ message Settings {
// after which the message should be available to consume again.
//
// For FIFO messages, the interval should be relatively small because
- // messages of the same message group would not be readily available utill
+ // messages of the same message group would not be readily available until
// the prior one depletes its lifecycle.
optional RetryPolicy backoff_policy = 3;
diff --git a/style/codespell/exclude_file.txt b/style/codespell/exclude_file.txt
new file mode 100644
index 00000000..7ef025b2
--- /dev/null
+++ b/style/codespell/exclude_file.txt
@@ -0,0 +1,5 @@
+ .Times(testing::AtLeast(1))
+
+ EXPECT_CALL(*rpc_client_,
asyncQueryRoute).Times(testing::AtLeast(1)).WillRepeatedly(testing::Invoke(rpc_cb));
+
+ EXPECT_CALL(*rpc_client_,
asyncAck).Times(testing::AtLeast(1)).WillRepeatedly(testing::Invoke(mock_ack));
diff --git a/style/codespell/ignore_words.txt b/style/codespell/ignore_words.txt
new file mode 100644
index 00000000..583d9073
--- /dev/null
+++ b/style/codespell/ignore_words.txt
@@ -0,0 +1,4 @@
+# guava
+errorprone
+# rust keyword
+crate
\ No newline at end of file