Browse Source

ZOOKEEPER-4834: add typos check in ci workflow (#2184)

Signed-off-by: ZhangJian He <shoothzj@gmail.com>
ZhangJian He 7 months ago
parent
commit
fa3c504fad

+ 18 - 0
.github/workflows/ci.yaml

@@ -86,3 +86,21 @@ jobs:
         name: failsafe-reports-${{ matrix.profile.name }}
         path: ./**/target/failsafe-reports/
         if-no-files-found: ignore
+  typo-check:
+    name: Typo Check
+    # only run on pull requests because of security reasons
+    # we shouldn't trust external actions for builds within the repository
+    if: ${{ github.event_name == 'pull_request' }}
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+      - name: Check typos
+        uses: crate-ci/typos@v1.22.4
+        # 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
+        # FP is configured in the project root directory in the `.typos.toml` file.
+        # You can refer to the `.typos.toml` documentation here:
+        # https://github.com/crate-ci/typos/blob/master/docs/reference.md

+ 2 - 2
zookeeper-metrics-providers/zookeeper-prometheus-metrics/src/test/java/org/apache/zookeeper/metrics/prometheus/PrometheusHttpsMetricsProviderTest.java

@@ -70,7 +70,7 @@ public class PrometheusHttpsMetricsProviderTest extends PrometheusMetricsTestBas
     }
 
     @Test
-    void testHttpResponce() throws Exception {
+    void testHttpResponse() throws Exception {
         Properties configuration = new Properties();
         configuration.setProperty("httpPort", String.valueOf(httpPort));
         initializeProviderWithCustomConfig(configuration);
@@ -88,7 +88,7 @@ public class PrometheusHttpsMetricsProviderTest extends PrometheusMetricsTestBas
     }
 
     @Test
-    void testHttpAndHttpsResponce() throws Exception {
+    void testHttpAndHttpsResponse() throws Exception {
         Properties configuration = new Properties();
         configuration.setProperty("httpsPort", String.valueOf(httpsPort));
         configuration.setProperty("httpPort", String.valueOf(httpPort));

+ 1 - 1
zookeeper-server/src/main/java/org/apache/zookeeper/server/persistence/TxnLog.java

@@ -46,7 +46,7 @@ public interface TxnLog extends Closeable {
     void rollLog() throws IOException;
 
     /**
-     * Append a request to the transaction log with a digset
+     * Append a request to the transaction log with a digest
      * @param request the request to be appended
      * returns true iff something appended, otw false
      * @throws IOException