From 6427d4649c84f7ff8898ea010dfe62699e80b671 Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Sat, 17 Dec 2022 06:28:26 -0500 Subject: [PATCH 1/4] Create lint workflow --- .github/workflows/lint.yml | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..065776e4 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,39 @@ +name: Linter + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Configure repo + run: | + git config --local user.email "githubaction@githubaction.com" + git config --local user.name "github-action update-app-version" + + - name: Use Node.js 18.x + uses: actions/setup-node@v3 + with: + node-version: 18.x + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Run linter + run: npm run lint:fix + + - name: Run formatter + run: npm run format:fix + + - name: Commit & Push Changes + run: | + git add "." && git commit -m "Lint fix" --no-verify && git push || true From 7907e43bd59bbc9ab3cafb41f9416193bef5c31d Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Sat, 17 Dec 2022 06:32:53 -0500 Subject: [PATCH 2/4] Update lint.yml --- .github/workflows/lint.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 065776e4..7745f9c5 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,6 +13,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.ref }} - name: Configure repo run: | From 066a2f170196dec01e13e0f968f4b5200637cef0 Mon Sep 17 00:00:00 2001 From: github-action update-app-version Date: Sat, 17 Dec 2022 11:33:34 +0000 Subject: [PATCH 3/4] Lint fix --- .../WebServer/WebSocket/Middleware/WebSocketMiddleware.bs | 2 +- src/source/utils/TimeUtils.bs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/WebServer/WebSocket/Middleware/WebSocketMiddleware.bs b/src/components/WebServer/WebSocket/Middleware/WebSocketMiddleware.bs index 3e5f983a..1ff68065 100644 --- a/src/components/WebServer/WebSocket/Middleware/WebSocketMiddleware.bs +++ b/src/components/WebServer/WebSocket/Middleware/WebSocketMiddleware.bs @@ -40,7 +40,7 @@ namespace Http response.source = Http.HttpResponseSource.GENERATED connection.ws_upgrade = true - + return true end function) end function diff --git a/src/source/utils/TimeUtils.bs b/src/source/utils/TimeUtils.bs index e2b3b93c..88551577 100644 --- a/src/source/utils/TimeUtils.bs +++ b/src/source/utils/TimeUtils.bs @@ -30,7 +30,7 @@ namespace TimeUtils if timeLeft > 1 result += "s" end if - return result + return result end if timeLeft = timeLeft / 60.0 @@ -40,7 +40,7 @@ namespace TimeUtils if timeLeft > 1 result += "s" end if - return result + return result end if timeLeft = timeLeft / 60.0 @@ -50,7 +50,7 @@ namespace TimeUtils if timeLeft > 1 result += "s" end if - return result + return result else timeLeft = timeLeft / 24.0 timeLeft = Cint(timeLeft) @@ -58,7 +58,7 @@ namespace TimeUtils if timeLeft > 1 result += "s" end if - return result + return result end if end function From 13231121ddc7a86139ffe17e1cd137335667edf1 Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Sat, 17 Dec 2022 06:40:14 -0500 Subject: [PATCH 4/4] Update lint.yml --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 7745f9c5..725723ae 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -19,7 +19,7 @@ jobs: - name: Configure repo run: | git config --local user.email "githubaction@githubaction.com" - git config --local user.name "github-action update-app-version" + git config --local user.name "github-action linter" - name: Use Node.js 18.x uses: actions/setup-node@v3