From 64007ffb796c14f36452b8240bedd7ee341f41f1 Mon Sep 17 00:00:00 2001 From: Justin Chu Date: Fri, 11 Oct 2024 10:52:19 -0700 Subject: [PATCH] Create suggestions to autofix files (#22115) --- .github/workflows/lint.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 2edbe2d814533..bc038f693194c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -72,6 +72,38 @@ jobs: category: lintrunner checkout_path: ${{ github.workspace }} + auto-apply-fixes: + name: Suggest fixes + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + steps: + - uses: actions/checkout@v4 + - name: Setup Python + uses: actions/setup-python@v5 + with: + # Version range or exact version of Python to use, using SemVer's version range syntax. Reads from .python-version if unset. + python-version: "3.10" + - name: Setup Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + components: rustfmt + - name: Install dependencies + run: | + python -m pip install -r requirements-dev.txt + python -m pip install lintrunner lintrunner-adapters + lintrunner init + - name: Run lintrunner on all files + run: | + set +e + lintrunner f --all-files -v + exit 0 + - uses: parkerbxyz/suggest-changes@v1 + with: + comment: 'You can commit the suggested changes from lintrunner.' + lint-cpp: name: Optional Lint C++ runs-on: ubuntu-latest