From 3fad2329418fe22cfe8d9d04943a3a905cd79611 Mon Sep 17 00:00:00 2001 From: mashehu Date: Fri, 5 Jan 2024 10:19:54 +0100 Subject: [PATCH] use pre-commit for tools job as well --- .github/workflows/lint-code.yml | 78 ++------------------------------- 1 file changed, 3 insertions(+), 75 deletions(-) diff --git a/.github/workflows/lint-code.yml b/.github/workflows/lint-code.yml index cc69408334..69ad009851 100644 --- a/.github/workflows/lint-code.yml +++ b/.github/workflows/lint-code.yml @@ -13,81 +13,9 @@ concurrency: cancel-in-progress: true jobs: - EditorConfig: - runs-on: ["self-hosted"] - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - node-version: "20" - - - name: Install editorconfig-checker - run: npm install -g editorconfig-checker - - # Run editor config check only on files not covered by a linter - - name: Run ECLint check - run: editorconfig-checker -exclude README.md $(git ls-files | grep -v 'test\|.py\|md\|json\|yml\|yaml\|html\|css\|Makefile') - - Prettier: - runs-on: ["self-hosted"] - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - node-version: "20" - - - name: Install Prettier - run: npm install -g prettier - - - name: Run Prettier --check - run: prettier --check ${GITHUB_WORKSPACE} - - Ruff: - runs-on: ["self-hosted"] - steps: - - name: Check out source-code repository - uses: actions/checkout@v4 - - - name: Set up Python 3.11 - uses: actions/setup-python@v4 - with: - python-version: 3.11 - - name: Install Ruff - run: | - python -m pip install --upgrade pip - pip install ruff - - name: Run Ruff check - run: ruff check . - - - name: Run Ruff format - run: ruff format . - - # If the above check failed, post a comment on the PR explaining the failure - - name: Post PR comment - if: failure() - uses: mshick/add-pr-comment@v2 - with: - message: | - ## Python linting (`ruff`) is failing - - To keep the code consistent with lots of contributors, we run automated code consistency checks. - To fix this CI test, please run: - - * Install [`ruff`](https://github.com/astral-sh/ruff): `pip install ruff` - * Fix formatting errors in your pipeline: `ruff check --fix .` and `ruff format .` - - Once you push these changes the test should pass, and you can hide this comment :+1: - - We highly recommend setting up Ruff in your code editor so that this formatting is done automatically on save. Ask about it on Slack for help! - - Thanks again for your contribution! - repo-token: ${{ secrets.GITHUB_TOKEN }} - allow-repeats: false - - static-type-check: - runs-on: ["self-hosted"] + Pre-commit: + name: Pre-commit + runs-on: ["ubuntu-latest"] steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4