diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..725723ae --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,41 @@ +name: Linter + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.ref }} + + - name: Configure repo + run: | + git config --local user.email "githubaction@githubaction.com" + git config --local user.name "github-action linter" + + - 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 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