From 16bc75aaf5fc86f7bdf2ac432c84884ab2283534 Mon Sep 17 00:00:00 2001 From: yorickdowne <71337066+yorickdowne@users.noreply.github.com> Date: Sun, 1 Sep 2024 19:24:13 -0400 Subject: [PATCH] Adding JSON linter (#127) --- .github/workflows/runner.yml | 11 +++++++++++ .pre-commit-config.yaml | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/.github/workflows/runner.yml b/.github/workflows/runner.yml index eac61d73..a5eef6d4 100644 --- a/.github/workflows/runner.yml +++ b/.github/workflows/runner.yml @@ -23,6 +23,17 @@ jobs: run: python -m mypy --config-file mypy.ini -p ethstaker_deposit - name: Run linter run: flake8 --config=flake8.ini ./ethstaker_deposit ./tests + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 'latest' + - name: Install jsonlint + run: npm install -g @prantlf/jsonlint + - name: Validate JSON files + run: | + for file in $(find ./ethstaker_deposit/intl -name "*.json"); do + jsonlint --no-duplicate-keys --quiet --compact $file + done ci-runner: needs: lint if: | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3da1d0bf..74ee128f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,3 +18,8 @@ repos: - ssz==0.5.0 files: ^ethstaker_deposit/ args: [--config-file, mypy.ini] +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: 'v4.6.0' + hooks: + - id: check-json + files: ^ethstaker_deposit/intl