From 34720de5873bd09bd03660a4a4584a5e6653664a Mon Sep 17 00:00:00 2001 From: silas-x Date: Thu, 26 Jan 2023 09:57:27 +0000 Subject: [PATCH] add prettier check --- .github/workflows/ci-code-review.yml | 10 +++++----- .husky/pre-commit | 2 +- package.json | 1 + 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-code-review.yml b/.github/workflows/ci-code-review.yml index f2f2dd5e..025bfe40 100644 --- a/.github/workflows/ci-code-review.yml +++ b/.github/workflows/ci-code-review.yml @@ -1,7 +1,7 @@ name: Code Review on: - pull_request: + pull_request: branches: ['main'] push: @@ -17,8 +17,8 @@ jobs: - run: semgrep ci --exclude 'public/charting_library' env: - SEMGREP_RULES: p/typescript - + SEMGREP_RULES: p/typescript + sca: name: Dependency Scan runs-on: ubuntu-latest @@ -34,7 +34,7 @@ jobs: ignore-unfixed: true hide-progress: true format: 'table' - + # Fail the job on critical vulnerabiliies with fix available - name: Fail on critical vulnerabilities uses: aquasecurity/trivy-action@master @@ -45,4 +45,4 @@ jobs: security-checks: 'vuln' # disable secrets scanning until public format: 'table' severity: 'CRITICAL' - exit-code: '1' \ No newline at end of file + exit-code: '1' diff --git a/.husky/pre-commit b/.husky/pre-commit index c8cc17a7..6a63f852 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,4 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" -yarn typecheck && yarn lint --quiet +yarn format && yarn typecheck && yarn lint --quiet diff --git a/package.json b/package.json index 594f1e67..372f28b3 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "dev": "rm -rf .next && next dev", "build": "next build", "start": "next start", + "format": "prettier --check .", "lint": "next lint", "typecheck": "tsc", "prepare": "husky install",