diff --git a/.github/workflows/typo_check.yml b/.github/workflows/typo_check.yml new file mode 100644 index 00000000000..9fe9d2fcd78 --- /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 00000000000..7c77274d7ef --- /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 853b29232f3..2428e654774 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 @@ private static void testValidatorAddFail(RestOperations template, String cseUrlP 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 @@ private static void testValidatorSayHiFail(RestOperations template, String cseUr 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 @@ private static void testValidatorExchangeFail(RestOperations template, String cs 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 909c19068b1..580192c71a1 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 @@ private void testDateTimeSchema() { private void testDateTimeSchemaMulticast() throws Exception { DiscoveryContext context = new DiscoveryContext(); VersionedCache serversVersionedCache = discoveryTree.discovery(context, "springmvctest", "springmvc"); - List enpoints = serversVersionedCache.data(); + List 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 @@ private Endpoint parseEndpoint(String endpointUri) throws Exception { private void testDateTimeSchemaMulticastRestTemplate() throws Exception { DiscoveryContext context = new DiscoveryContext(); VersionedCache serversVersionedCache = discoveryTree.discovery(context, "springmvctest", "springmvc"); - List enpoints = serversVersionedCache.data(); + List 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 67d1931e15f..df9f8236215 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 void testAllTransport() throws Exception { testGenericsModel(); - testSpecailNameModel(); + testSpecialNameModel(); } - private void testSpecailNameModel() { + private void testSpecialNameModel() { SpecialNameModel model = new SpecialNameModel(); model.setaIntName(30); SpecialNameModel result = specialNameModelInf.specialNameModel(0, model);