Skip to content

Commit 5f2788b

Browse files
ci: fix typos and optimize code format
- Fixed spelling errors in multiple files, such as "prefex" being changed to "prefix", "ser" being changed to "serialize", etc. - Optimize some code formats to improve readability - Update the test result display format to make the data clearer
1 parent 33ed42c commit 5f2788b

File tree

21 files changed

+99
-96
lines changed

21 files changed

+99
-96
lines changed

.typos.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@
2424
"vertx" = "vertx"
2525

2626
[files]
27-
ignore = [
28-
"**/cobertura.ser"
27+
extend-exclude = [
28+
"**/cobertura.ser" # 排除该路径
2929
]
30-
[words]
31-
allow = [
30+
[default]
31+
extend-ignore-words-re = [
3232
"Verticle",
3333
"verticle",
3434
"VERTICLE",
3535
"Prelease",
36+
"cobertura",
37+
"ser",
3638
]

core/src/test/resources/test/test/microservice.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
service_description:
1919
name: default
2020
version: 0.0.1
21-
propertyExtentedClass: org.apache.servicecomb.serviceregistry.MicroServicePropertyExtendedStub
21+
propertyExtendedClass: org.apache.servicecomb.serviceregistry.MicroServicePropertyExtendedStub
2222
servicecomb:
2323
service:
2424
registry:

demo/demo-cse-v1/test-client/src/main/java/org/apache/servicecomb/samples/HelloWorldIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public void testRestTransport() throws Exception {
3939
testHelloWorld();
4040
testHelloWorldCanary();
4141
testHelloWorldEmptyProtectionCloseWeight100();
42-
testHelloWorldeEptyProtectionCloseWeightLess100();
42+
testHelloWorldeEmptyProtectionCloseWeightLess100();
4343
testHelloWorldEmptyProtectionCloseFallback();
4444
testHelloWorldEmptyProtectionCloseWeight100Two();
4545
}
@@ -142,7 +142,7 @@ private void testHelloWorldEmptyProtectionCloseWeight100() {
142142
TestMgr.check(failCount == 20, true);
143143
}
144144

145-
private void testHelloWorldeEptyProtectionCloseWeightLess100() {
145+
private void testHelloWorldeEmptyProtectionCloseWeightLess100() {
146146
int failCount = 0;
147147
int succCount = 0;
148148

demo/demo-cse-v2/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ cse:
6060
priority1: v1
6161
```
6262
63-
* 服务级配置:consumerSer.yaml,微服务性选择consumer。类型为 yaml。
63+
* 服务级配置:consumerService.yaml,微服务性选择consumer。类型为 yaml。
6464
```yaml
6565
cse:
6666
v2:
@@ -115,7 +115,7 @@ cse:
115115
116116
* 执行 tests-client 里面的集成测试用例 (成功)
117117
* 修改
118-
* 服务级配置:consumerSer.yaml。
118+
* 服务级配置:consumerService.yaml。
119119
```yaml
120120
cse:
121121
v2:

demo/demo-schema/src/main/java/org/apache/servicecomb/demo/TestMgr.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class TestMgr {
3232

3333
private static String msg = "";
3434

35-
private static final AtomicLong checkes = new AtomicLong(0);
35+
private static final AtomicLong checks = new AtomicLong(0);
3636

3737
public static void setMsg(String msg) {
3838
TestMgr.msg = msg;
@@ -47,7 +47,7 @@ public static void check(Object expect, Object real) {
4747
}
4848

4949
public static void check(Object expect, Object real, Throwable error) {
50-
checkes.incrementAndGet();
50+
checks.incrementAndGet();
5151

5252
if (expect == real) {
5353
return;
@@ -66,7 +66,7 @@ public static void check(Object expect, Object real, Throwable error) {
6666
}
6767

6868
public static void checkNotEmpty(String real) {
69-
checkes.incrementAndGet();
69+
checks.incrementAndGet();
7070

7171
if (StringUtils.isEmpty(real)) {
7272
errorList.add(new Error(msg + " | unexpected null result, method is " + getCaller()));
@@ -78,7 +78,7 @@ public static void fail(String desc) {
7878
}
7979

8080
public static void failed(String desc, Throwable e) {
81-
checkes.incrementAndGet();
81+
checks.incrementAndGet();
8282

8383
Error error = new Error(msg + " | " + desc + ", method is " + getCaller());
8484
if (e != null) {
@@ -94,12 +94,12 @@ public static boolean isSuccess() {
9494
public static void summary() {
9595
if (errorList.isEmpty()) {
9696
LOGGER.info("............. test finished ............");
97-
LOGGER.info("............. total checks : " + checkes.get());
97+
LOGGER.info("............. total checks : " + checks.get());
9898
return;
9999
}
100100

101101
LOGGER.info("............. test not finished ............");
102-
LOGGER.info("............. total checks : " + checkes.get());
102+
LOGGER.info("............. total checks : " + checks.get());
103103
LOGGER.info("............. total errors : " + errorList.size());
104104
LOGGER.info("............. error details: ");
105105
for (Throwable e : errorList) {

demo/demo-spring-boot-transport/demo-spring-boot-springmvc-client/src/main/java/org/apache/servicecomb/springboot/springmvc/client/UploadDownloadSchemaTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ public class UploadDownloadSchemaTest implements CategorizedTestCase {
3838
@Override
3939
public void testRestTransport() throws Exception {
4040
testEmptyFileUploadWork();
41-
testNonEmptyFileUploadWorkd();
41+
testNonEmptyFileUploadWork();
4242
}
4343

44-
private void testNonEmptyFileUploadWorkd() throws Exception {
44+
private void testNonEmptyFileUploadWork() throws Exception {
4545
String file2Content = " bonjour";
4646
File someFile = File.createTempFile("upload2", ".txt");
4747
FileUtils.writeStringToFile(someFile, file2Content, StandardCharsets.UTF_8, false);

demo/demo-springmvc/springmvc-client/src/main/java/org/apache/servicecomb/demo/springmvc/client/CodeFirstRestTemplateSpringmvc.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -213,12 +213,12 @@ private void testCodeFirstTestForm(RestOperations template, String cseUrlPrefix)
213213
Map<String, String> map = new HashMap<>();
214214
String code = "servicecomb%2bwelcome%40%23%24%25%5e%26*()%3d%3d";
215215
map.put("form1", code);
216-
HttpEntity<Map<String, String>> formEntiry = new HttpEntity<>(map, formHeaders);
216+
HttpEntity<Map<String, String>> formEntry = new HttpEntity<>(map, formHeaders);
217217
TestMgr.check(code + "null",
218-
template.postForEntity(cseUrlPrefix + "/testform", formEntiry, String.class).getBody());
218+
template.postForEntity(cseUrlPrefix + "/testform", formEntry, String.class).getBody());
219219
map.put("form2", "hello");
220220
TestMgr
221-
.check(code + "hello", template.postForEntity(cseUrlPrefix + "/testform", formEntiry, String.class).getBody());
221+
.check(code + "hello", template.postForEntity(cseUrlPrefix + "/testform", formEntry, String.class).getBody());
222222
}
223223

224224
private void testCodeFirstTestFormHighway(RestOperations template, String cseUrlPrefix) {
@@ -228,16 +228,16 @@ private void testCodeFirstTestFormHighway(RestOperations template, String cseUrl
228228
String code = "servicecomb%2bwelcome%40%23%24%25%5e%26*()%3d%3d";
229229
map.put("form1", code);
230230
map.put("form2", "");
231-
HttpEntity<Map<String, String>> formEntiry = new HttpEntity<>(map, formHeaders);
232-
TestMgr.check(code + "", template.postForEntity(cseUrlPrefix + "/testform", formEntiry, String.class).getBody());
231+
HttpEntity<Map<String, String>> formEntry = new HttpEntity<>(map, formHeaders);
232+
TestMgr.check(code + "", template.postForEntity(cseUrlPrefix + "/testform", formEntry, String.class).getBody());
233233

234234
map = new HashMap<>();
235235
code = "servicecomb%2bwelcome%40%23%24%25%5e%26*()%3d%3d";
236236
map.put("form1", code);
237237
map.put("form2", null);
238-
formEntiry = new HttpEntity<>(map, formHeaders);
238+
formEntry = new HttpEntity<>(map, formHeaders);
239239
TestMgr.check(code + "null",
240-
template.postForEntity(cseUrlPrefix + "/testform", formEntiry, String.class).getBody());
240+
template.postForEntity(cseUrlPrefix + "/testform", formEntry, String.class).getBody());
241241
}
242242

243243
private void testCodeFirstTestFormRest(RestOperations template, String cseUrlPrefix) {
@@ -247,8 +247,8 @@ private void testCodeFirstTestFormRest(RestOperations template, String cseUrlPre
247247
String code = "servicecomb%2bwelcome%40%23%24%25%5e%26*()%3d%3d";
248248
map.put("form1", code);
249249
map.put("form2", "");
250-
HttpEntity<Map<String, String>> formEntiry = new HttpEntity<>(map, formHeaders);
250+
HttpEntity<Map<String, String>> formEntry = new HttpEntity<>(map, formHeaders);
251251
// Rest will have empty string, but users will try to avoid depend on this, This is different from highway
252-
TestMgr.check(code + "", template.postForEntity(cseUrlPrefix + "/testform", formEntiry, String.class).getBody());
252+
TestMgr.check(code + "", template.postForEntity(cseUrlPrefix + "/testform", formEntry, String.class).getBody());
253253
}
254254
}

demo/demo-springmvc/springmvc-server/src/main/java/org/apache/servicecomb/demo/springmvc/server/CodeFirstSpringmvc.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ public String addString(@RequestParam(name = "s") List<String> s) {
302302
}
303303

304304
// Using 490, 590 error code, the response type should be CommonExceptionData. Or we need
305-
// complex ExceptionConverters to deal with exceptions thrown by Hanlders, etc.
305+
// complex ExceptionConverters to deal with exceptions thrown by Handlers, etc.
306306
@RequestMapping(path = "/fallback/returnnull/{name}", method = RequestMethod.GET)
307307
@ApiResponses(value = {@ApiResponse(responseCode = "200",
308308
content = @Content(schema = @Schema(implementation = String.class)), description = "xxx"),

demo/demo-springmvc/springmvc-server/src/main/java/org/apache/servicecomb/demo/springmvc/server/CodeFirstSpringmvcForSchema.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* only checksum is validated to make sure schema is not changed.
3333
*/
3434
@RestSchema(schemaId = "CodeFirstSpringmvcForSchema")
35-
@RequestMapping(path = "/forScheam")
35+
@RequestMapping(path = "/forSchema")
3636
public class CodeFirstSpringmvcForSchema {
3737
/*
3838
* Using http://editor.swagger.io/ . Listing errors not handled:

demo/demo-springmvc/springmvc-server/src/main/resources/schemas/CodeFirstSpringmvcForSchema.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ info:
2121
title: swagger definition for org.apache.servicecomb.demo.springmvc.server.CodeFirstSpringmvcForSchema
2222
version: 1.0.0
2323
servers:
24-
- url: /forScheam
24+
- url: /forSchema
2525
paths:
2626
/uploadFile:
2727
post:

0 commit comments

Comments
 (0)