You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by ju...@apache.org on 2020/10/23 04:17:28 UTC

[apisix-dashboard] 04/04: feat: prettier lint

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

juzhiyuan pushed a commit to branch docs-improvment
in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git

commit e7383331125992463f96bb596c0568b413da7d8a
Author: juzhiyuan <ju...@apache.org>
AuthorDate: Fri Oct 23 12:17:01 2020 +0800

    feat: prettier lint
---
 .github/workflows/deploy-api.yml       | 84 +++++++++++++++++-----------------
 .github/workflows/test-api.yml         | 77 +++++++++++++++----------------
 README.md                              |  4 +-
 README.zh-CN.md                        |  3 +-
 api/internal/core/store/test_case.json |  2 +-
 5 files changed, 83 insertions(+), 87 deletions(-)

diff --git a/.github/workflows/deploy-api.yml b/.github/workflows/deploy-api.yml
index 4d729af..d996e52 100644
--- a/.github/workflows/deploy-api.yml
+++ b/.github/workflows/deploy-api.yml
@@ -19,52 +19,52 @@ jobs:
           ALLOW_NONE_AUTHENTICATION: yes
 
     steps:
-    - uses: actions/checkout@v2
+      - uses: actions/checkout@v2
 
-    - name: license check
-      run: |
-        make license-check
+      - name: license check
+        run: |
+          make license-check
 
-    - name: get lua lib
-      run: |
-        wget https://github.com/api7/dag-to-lua/archive/v1.1.tar.gz
-        sudo mkdir -p /go/manager-api/dag-to-lua/
-        tar -zxvf v1.1.tar.gz
-        sudo mv ./dag-to-lua-1.1/lib/* /go/manager-api/dag-to-lua/
+      - name: get lua lib
+        run: |
+          wget https://github.com/api7/dag-to-lua/archive/v1.1.tar.gz
+          sudo mkdir -p /go/manager-api/dag-to-lua/
+          tar -zxvf v1.1.tar.gz
+          sudo mv ./dag-to-lua-1.1/lib/* /go/manager-api/dag-to-lua/
 
-    - name: install runtime
-      run: |
-        sudo apt-get update
-        sudo apt-get install lua5.1
-        sudo add-apt-repository ppa:longsleep/golang-backports
-        sudo apt update
-        export GO111MOUDULE=on
-        sudo apt install golang-1.14-go
+      - name: install runtime
+        run: |
+          sudo apt-get update
+          sudo apt-get install lua5.1
+          sudo add-apt-repository ppa:longsleep/golang-backports
+          sudo apt update
+          export GO111MOUDULE=on
+          sudo apt install golang-1.14-go
 
-    - name: generate json schema
-      working-directory: ./api
-      run: |
-        wget https://github.com/apache/apisix/archive/master.zip
-        mkdir -p ./build-tools/apisix/
-        unzip master.zip
-        sudo mv ./apisix-master/apisix/* ./build-tools/apisix/
-        rm -rf ./apisix-master
-        cd ./build-tools/ && lua schema-sync.lua > ../conf/schema.json
+      - name: generate json schema
+        working-directory: ./api
+        run: |
+          wget https://github.com/apache/apisix/archive/master.zip
+          mkdir -p ./build-tools/apisix/
+          unzip master.zip
+          sudo mv ./apisix-master/apisix/* ./build-tools/apisix/
+          rm -rf ./apisix-master
+          cd ./build-tools/ && lua schema-sync.lua > ../conf/schema.json
 
-    - name: run test
-      working-directory: ./api
-      run: |
-        export APIX_ETCD_ENDPOINTS=127.0.0.1:2379
-        go test ./...
+      - name: run test
+        working-directory: ./api
+        run: |
+          export APIX_ETCD_ENDPOINTS=127.0.0.1:2379
+          go test ./...
 
-    - uses: Azure/docker-login@v1
-      with:
-        login-server: apisixacr.azurecr.cn
-        username: ${{ secrets.REGISTRY_USERNAME }}
-        password: ${{ secrets.REGISTRY_PASSWORD }}
+      - uses: Azure/docker-login@v1
+        with:
+          login-server: apisixacr.azurecr.cn
+          username: ${{ secrets.REGISTRY_USERNAME }}
+          password: ${{ secrets.REGISTRY_PASSWORD }}
 
-    - name: build and push docker image
-      working-directory: ./api
-      run: |
-        docker build . -t apisixacr.azurecr.cn/managerapi:${{ github.sha }}
-        docker push apisixacr.azurecr.cn/managerapi:${{ github.sha }}
\ No newline at end of file
+      - name: build and push docker image
+        working-directory: ./api
+        run: |
+          docker build . -t apisixacr.azurecr.cn/managerapi:${{ github.sha }}
+          docker push apisixacr.azurecr.cn/managerapi:${{ github.sha }}
diff --git a/.github/workflows/test-api.yml b/.github/workflows/test-api.yml
index 83f4dba..386c52d 100644
--- a/.github/workflows/test-api.yml
+++ b/.github/workflows/test-api.yml
@@ -9,10 +9,9 @@ on:
       - master
 
 jobs:
-
   run-test:
     runs-on: ubuntu-latest
-    
+
     services:
       etcd:
         image: bitnami/etcd:3.4.13
@@ -23,40 +22,40 @@ jobs:
           ALLOW_NONE_AUTHENTICATION: yes
 
     steps:
-    - uses: actions/checkout@v2
-
-    - name: run Makefile
-      run: |
-        make license-check
-
-    - name: get lua lib
-      run: |
-        wget https://github.com/api7/dag-to-lua/archive/v1.1.tar.gz
-        sudo mkdir -p /go/manager-api/dag-to-lua/
-        tar -zxvf v1.1.tar.gz
-        sudo mv ./dag-to-lua-1.1/lib/* /go/manager-api/dag-to-lua/
-
-    - name: install runtime
-      run: |
-        sudo apt-get update
-        sudo apt-get install lua5.1
-        sudo add-apt-repository ppa:longsleep/golang-backports
-        sudo apt update
-        export GO111MOUDULE=on
-        sudo apt install golang-1.14-go
-
-    - name: generate json schema
-      working-directory: ./api
-      run: |
-        wget https://github.com/apache/apisix/archive/master.zip
-        mkdir -p ./build-tools/apisix/
-        unzip master.zip
-        sudo mv ./apisix-master/apisix/* ./build-tools/apisix/
-        rm -rf ./apisix-master
-        cd ./build-tools/ && lua schema-sync.lua > ../conf/schema.json
-
-    - name: run test
-      working-directory: ./api
-      run: |
-        export APIX_ETCD_ENDPOINTS=127.0.0.1:2379
-        go test ./...
+      - uses: actions/checkout@v2
+
+      - name: run Makefile
+        run: |
+          make license-check
+
+      - name: get lua lib
+        run: |
+          wget https://github.com/api7/dag-to-lua/archive/v1.1.tar.gz
+          sudo mkdir -p /go/manager-api/dag-to-lua/
+          tar -zxvf v1.1.tar.gz
+          sudo mv ./dag-to-lua-1.1/lib/* /go/manager-api/dag-to-lua/
+
+      - name: install runtime
+        run: |
+          sudo apt-get update
+          sudo apt-get install lua5.1
+          sudo add-apt-repository ppa:longsleep/golang-backports
+          sudo apt update
+          export GO111MOUDULE=on
+          sudo apt install golang-1.14-go
+
+      - name: generate json schema
+        working-directory: ./api
+        run: |
+          wget https://github.com/apache/apisix/archive/master.zip
+          mkdir -p ./build-tools/apisix/
+          unzip master.zip
+          sudo mv ./apisix-master/apisix/* ./build-tools/apisix/
+          rm -rf ./apisix-master
+          cd ./build-tools/ && lua schema-sync.lua > ../conf/schema.json
+
+      - name: run test
+        working-directory: ./api
+        run: |
+          export APIX_ETCD_ENDPOINTS=127.0.0.1:2379
+          go test ./...
diff --git a/README.md b/README.md
index 745be50..9d54456 100644
--- a/README.md
+++ b/README.md
@@ -59,8 +59,7 @@ The `manager-api` is used to provide APIs for Dashboard, just like a bridge betw
 $ go env -w GO111MODULE=on
 ```
 
-- According to your local deployment environment, check the environment variables in `./api/run.sh`, modify the environment variables if needed.
-For example, change the ETCD endpoints to your ETCD instances work with APISIX:
+- According to your local deployment environment, check the environment variables in `./api/run.sh`, modify the environment variables if needed. For example, change the ETCD endpoints to your ETCD instances work with APISIX:
 
 ```
 export APIX_ETCD_ENDPOINTS="127.0.0.1:2379"
@@ -84,7 +83,6 @@ $ go env -w GOPROXY=https://goproxy.cn,direct
 $ ./api/run.sh &
 ```
 
-
 ### Build the Dashboard
 
 This project is initialized with [Ant Design Pro](https://pro.ant.design). The following are some quick guides for how to use.
diff --git a/README.zh-CN.md b/README.zh-CN.md
index 7772595..54e3462 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -59,8 +59,7 @@ $ cd apisix-dashboard
 $ go env -w GO111MODULE=on
 ```
 
-- 根据您的本地部署环境,检查 `./api/run.sh` 中的环境变量,如果需要请修改环境变量。
-例如, 把 ETCD 地址改为你的与 APISIX 一起工作的 ETCD 实例:
+- 根据您的本地部署环境,检查 `./api/run.sh` 中的环境变量,如果需要请修改环境变量。例如, 把 ETCD 地址改为你的与 APISIX 一起工作的 ETCD 实例:
 
 ```
 export APIX_ETCD_ENDPOINTS="127.0.0.1:2379"
diff --git a/api/internal/core/store/test_case.json b/api/internal/core/store/test_case.json
index 77f524b..950edf3 100644
--- a/api/internal/core/store/test_case.json
+++ b/api/internal/core/store/test_case.json
@@ -2,7 +2,7 @@
   "$schema": "http://json-schema.org/draft-04/schema#",
   "type": "object",
   "properties": {
-    "name":  {
+    "name": {
       "type": "string",
       "minLength": 10
     },