From 80672197fd7de1ddd6aedaec69d4e582828ac6cd Mon Sep 17 00:00:00 2001 From: Hongbo Miao Date: Mon, 28 Nov 2022 00:23:42 -0800 Subject: [PATCH] ci(app): lint yaml --- .github/workflows/test.yml | 29 +++++++++++++++++++++++++++++ .mergify.yml | 2 ++ Makefile | 18 +++++++++--------- pyproject.toml | 2 +- 4 files changed, 41 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fb7f6f0424..4d534a7a53 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -288,6 +288,35 @@ jobs: run: | terraform fmt -recursive -check + lint-yaml: + name: Lint (YAML) + runs-on: ubuntu-22.04 + timeout-minutes: 10 + steps: + - name: Cancel previous runs + uses: styfle/cancel-workflow-action@0.11.0 + with: + access_token: ${{ github.token }} + - name: Checkout + uses: actions/checkout@v3 + - name: Install Poetry + run: | + pipx install poetry + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' + cache: 'poetry' + - name: Set Poetry environment + run: | + poetry env use 3.11 + - name: Install dependencies + run: | + poetry install --no-root + - name: Lint YAML + run: | + poetry run poe lint-yaml + static-type-check-python: name: Static Type Check (Python) runs-on: ubuntu-22.04 diff --git a/.mergify.yml b/.mergify.yml index b433687f03..9d27e375e7 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -17,6 +17,7 @@ pull_request_rules: - check-success=Lint (Ruby) - check-success=Lint (Shell) - check-success=Lint (Terraform) + - check-success=Lint (YAML) - check-success=Static Type Check (Python) - check-success=Static Type Check (Terraform) - check-success=Static Type Check (TypeScript) @@ -58,6 +59,7 @@ pull_request_rules: - check-success=Lint (Ruby) - check-success=Lint (Shell) - check-success=Lint (Terraform) + - check-success=Lint (YAML) - check-success=Static Type Check (Python) - check-success=Static Type Check (Terraform) - check-success=Static Type Check (TypeScript) diff --git a/Makefile b/Makefile index f419d0d82b..3fbc8983c6 100644 --- a/Makefile +++ b/Makefile @@ -91,15 +91,6 @@ poetry-add: poetry-add-dev: poetry add xxx --group=dev -static-type-check-python: - poetry run poe static-type-check-python --package=api-python - poetry run poe static-type-check-python --package=convolutional-neural-network - poetry run poe static-type-check-python --package=graph-neural-network - poetry run poe static-type-check-python --package=hm-locust - poetry run poe static-type-check-python --package=hm-opal-client - poetry run poe static-type-check-python --package=hm-prefect - poetry run poe static-type-check-python --package=hm-pyspark - poetry run poe static-type-check-python --package=quantum-computing lint-python-black: poetry run poe lint-python-black lint-python-black-fix: @@ -112,6 +103,15 @@ lint-python-isort-fix: poetry run poe lint-python-isort-fix lint-yaml: poetry run poe lint-yaml +static-type-check-python: + poetry run poe static-type-check-python --package=api-python + poetry run poe static-type-check-python --package=convolutional-neural-network + poetry run poe static-type-check-python --package=graph-neural-network + poetry run poe static-type-check-python --package=hm-locust + poetry run poe static-type-check-python --package=hm-opal-client + poetry run poe static-type-check-python --package=hm-prefect + poetry run poe static-type-check-python --package=hm-pyspark + poetry run poe static-type-check-python --package=quantum-computing # Lint lint-dockerfile: diff --git a/pyproject.toml b/pyproject.toml index 65d51b3852..78c6eba259 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,10 +20,10 @@ requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" [tool.poe.tasks] -static-type-check-python = "mypy --install-types --non-interactive" lint-python-black = "black . --check" lint-python-black-fix = "black ." lint-python-flake8 = "flake8 ." lint-python-isort = "isort . --check-only" lint-python-isort-fix = "isort ." lint-yaml = "yamllint ." +static-type-check-python = "mypy --install-types --non-interactive"