This is an automated email from the ASF dual-hosted git repository.

shoothzj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-java-chassis.git


The following commit(s) were added to refs/heads/master by this push:
     new ff30f5c75 ci: add typos check in ci workflow (#4601)
ff30f5c75 is described below

commit ff30f5c7578b25cc09675f85d5e4a62b4a1d6610
Author: hpc <[email protected]>
AuthorDate: Thu Nov 21 15:34:53 2024 +0800

    ci: add typos check in ci workflow (#4601)
    
    Co-authored-by: ZhangJian He <[email protected]>
---
 .github/workflows/typo_check.yml                   | 38 ++++++++++++++++++++++
 .typos.toml                                        | 24 ++++++++++++++
 .../apache/servicecomb/demo/jaxrs/JaxrsClient.java |  6 ++--
 .../demo/springmvc/client/TestDateTimeSchema.java  |  8 ++---
 .../demo/springmvc/client/TestWeakSpringmvc.java   |  4 +--
 5 files changed, 71 insertions(+), 9 deletions(-)

diff --git a/.github/workflows/typo_check.yml b/.github/workflows/typo_check.yml
new file mode 100644
index 000000000..9fe9d2fcd
--- /dev/null
+++ b/.github/workflows/typo_check.yml
@@ -0,0 +1,38 @@
+#
+# 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.
+#
+
+name: typo check
+on:
+  pull_request:
+    branches:
+      - master
+
+jobs:
+  typo-check:
+    timeout-minutes: 60
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+        # To run the typo check locally, you can follow these steps:
+        # 1. Install typos locally using cargo:
+        #    cargo install typos-cli
+        # 2. Run the typo check with the following command:
+        #    typos
+      - name: Check typos
+        uses: crate-ci/typos@master
diff --git a/.typos.toml b/.typos.toml
new file mode 100644
index 000000000..7c77274d7
--- /dev/null
+++ b/.typos.toml
@@ -0,0 +1,24 @@
+#
+# 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.
+#
+
+[default.extend-words]
+"fo" = "fo"
+"VERTX" = "VERTX"
+"Vertx" = "Vertx"
+"vertx" = "vertx"
diff --git 
a/demo/demo-jaxrs/jaxrs-client/src/main/java/org/apache/servicecomb/demo/jaxrs/JaxrsClient.java
 
b/demo/demo-jaxrs/jaxrs-client/src/main/java/org/apache/servicecomb/demo/jaxrs/JaxrsClient.java
index 853b29232..2428e6547 100644
--- 
a/demo/demo-jaxrs/jaxrs-client/src/main/java/org/apache/servicecomb/demo/jaxrs/JaxrsClient.java
+++ 
b/demo/demo-jaxrs/jaxrs-client/src/main/java/org/apache/servicecomb/demo/jaxrs/JaxrsClient.java
@@ -388,7 +388,7 @@ public class JaxrsClient {
       isExcep = true;
       TestMgr.check(400, e.getStatus().getStatusCode());
       TestMgr.check(Status.BAD_REQUEST, e.getReasonPhrase());
-      // Message dependends on locale, so just check the short part.
+      // Message depended on locale, so just check the short part.
       // 'must be greater than or equal to 20', propertyPath=add.arg1, 
rootBeanClass=class org.apache.servicecomb.demo.jaxrs.server.Validator, 
messageTemplate='{jakarta.validation.constraints.Min.message}'}]]
       // ignored
       if (e.getErrorData() instanceof CommonExceptionData) {
@@ -426,7 +426,7 @@ public class JaxrsClient {
       isExcep = true;
       TestMgr.check(400, e.getStatus().getStatusCode());
       TestMgr.check(Status.BAD_REQUEST, e.getReasonPhrase());
-      // Message dependends on locale, so just check the short part.
+      // Message depended on locale, so just check the short part.
       if (e.getErrorData() instanceof CommonExceptionData) {
         // highway decode/encode 'Object' with special type information, got 
runtime type
         CommonExceptionData data = (CommonExceptionData) e.getErrorData();
@@ -468,7 +468,7 @@ public class JaxrsClient {
       isExcep = true;
       TestMgr.check(400, e.getStatus().getStatusCode());
       TestMgr.check(Status.BAD_REQUEST, e.getReasonPhrase());
-      // Message dependends on locale, so just check the short part.
+      // Message depended on locale, so just check the short part.
       if (e.getErrorData() instanceof CommonExceptionData) {
         // highway decode/encode 'Object' with special type information, got 
runtime type
         CommonExceptionData data = (CommonExceptionData) e.getErrorData();
diff --git 
a/demo/demo-springmvc/springmvc-client/src/main/java/org/apache/servicecomb/demo/springmvc/client/TestDateTimeSchema.java
 
b/demo/demo-springmvc/springmvc-client/src/main/java/org/apache/servicecomb/demo/springmvc/client/TestDateTimeSchema.java
index 909c19068..580192c71 100644
--- 
a/demo/demo-springmvc/springmvc-client/src/main/java/org/apache/servicecomb/demo/springmvc/client/TestDateTimeSchema.java
+++ 
b/demo/demo-springmvc/springmvc-client/src/main/java/org/apache/servicecomb/demo/springmvc/client/TestDateTimeSchema.java
@@ -131,9 +131,9 @@ public class TestDateTimeSchema implements 
CategorizedTestCase {
   private void testDateTimeSchemaMulticast() throws Exception {
     DiscoveryContext context = new DiscoveryContext();
     VersionedCache serversVersionedCache = discoveryTree.discovery(context, 
"springmvctest", "springmvc");
-    List<String> enpoints = serversVersionedCache.data();
+    List<String> endpoints = serversVersionedCache.data();
 
-    for (String endpoint : enpoints) {
+    for (String endpoint : endpoints) {
       InvocationContext invocationContext = new InvocationContext();
       
invocationContext.addLocalContext(LoadBalanceFilter.SERVICECOMB_SERVER_ENDPOINT,
 endpoint);
       Date date = new Date();
@@ -155,11 +155,11 @@ public class TestDateTimeSchema implements 
CategorizedTestCase {
   private void testDateTimeSchemaMulticastRestTemplate() throws Exception {
     DiscoveryContext context = new DiscoveryContext();
     VersionedCache serversVersionedCache = discoveryTree.discovery(context, 
"springmvctest", "springmvc");
-    List<String> enpoints = serversVersionedCache.data();
+    List<String> endpoints = serversVersionedCache.data();
 
     RestOperations restTemplate = RestTemplateBuilder.create();
 
-    for (String endpoint : enpoints) {
+    for (String endpoint : endpoints) {
       CseHttpEntity<?> entity = new CseHttpEntity<>(null);
       InvocationContext invocationContext = new InvocationContext();
       
invocationContext.addLocalContext(LoadBalanceFilter.SERVICECOMB_SERVER_ENDPOINT,
 endpoint);
diff --git 
a/demo/demo-springmvc/springmvc-client/src/main/java/org/apache/servicecomb/demo/springmvc/client/TestWeakSpringmvc.java
 
b/demo/demo-springmvc/springmvc-client/src/main/java/org/apache/servicecomb/demo/springmvc/client/TestWeakSpringmvc.java
index 67d1931e1..df9f82362 100644
--- 
a/demo/demo-springmvc/springmvc-client/src/main/java/org/apache/servicecomb/demo/springmvc/client/TestWeakSpringmvc.java
+++ 
b/demo/demo-springmvc/springmvc-client/src/main/java/org/apache/servicecomb/demo/springmvc/client/TestWeakSpringmvc.java
@@ -128,10 +128,10 @@ public class TestWeakSpringmvc implements 
CategorizedTestCase {
 
     testGenericsModel();
 
-    testSpecailNameModel();
+    testSpecialNameModel();
   }
 
-  private void testSpecailNameModel() {
+  private void testSpecialNameModel() {
     SpecialNameModel model = new SpecialNameModel();
     model.setaIntName(30);
     SpecialNameModel result = specialNameModelInf.specialNameModel(0, model);

Reply via email to