From 95d4cc12003b4a714ec37c7372d179ca50affaef Mon Sep 17 00:00:00 2001 From: Will Constable Date: Fri, 23 Feb 2024 15:58:23 -0800 Subject: [PATCH 1/6] Add the linter back This reverts commit acb50a91c5e655eca34e3ea2bd7de9d2659b5174. --- .github/workflows/lint.yaml | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/lint.yaml diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 0000000000..03d6d5555e --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,39 @@ +name: Lint + +on: + pull_request: + +concurrency: + group: lint-${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_number || github.ref }} + cancel-in-progress: true + +defaults: + run: + shell: bash -l -eo pipefail {0} + +jobs: + lint: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.11'] + steps: + - name: Check out repo + uses: actions/checkout@v3 + - name: Setup python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Update pip + run: python -m pip install --upgrade pip + - name: Install lint utilities + run: | + python -m pip install pre-commit + pre-commit install-hooks + - id: file_changes + uses: trilom/file-changes-action@v1.2.4 + with: + prNumber: ${{ github.event.number }} + output: ' ' + - name: Lint modified files + run: pre-commit run --files ${{ steps.file_changes.outputs.files }} From bd8a8c225020148d22bf3245b9dd5f47b8e92c63 Mon Sep 17 00:00:00 2001 From: Will Constable Date: Fri, 23 Feb 2024 16:05:47 -0800 Subject: [PATCH 2/6] try removing pr number thing --- .github/workflows/lint.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 03d6d5555e..6b6b305f89 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -32,8 +32,5 @@ jobs: pre-commit install-hooks - id: file_changes uses: trilom/file-changes-action@v1.2.4 - with: - prNumber: ${{ github.event.number }} - output: ' ' - name: Lint modified files run: pre-commit run --files ${{ steps.file_changes.outputs.files }} From 610406f23d7215df6e26af91c2f058478f49846e Mon Sep 17 00:00:00 2001 From: Will Constable Date: Fri, 23 Feb 2024 16:10:09 -0800 Subject: [PATCH 3/6] use other changed-files plugin --- .github/workflows/lint.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 6b6b305f89..2644512e51 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -30,7 +30,8 @@ jobs: run: | python -m pip install pre-commit pre-commit install-hooks - - id: file_changes - uses: trilom/file-changes-action@v1.2.4 + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v41.0.0 - name: Lint modified files - run: pre-commit run --files ${{ steps.file_changes.outputs.files }} + run: pre-commit run --files ${{ steps.changed-files.outputs.all_changed_files }} From 50ac53d5df7811a440a942c333bf65000a710769 Mon Sep 17 00:00:00 2001 From: Will Constable Date: Fri, 23 Feb 2024 16:12:45 -0800 Subject: [PATCH 4/6] add file with broken lint --- ugly_file.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 ugly_file.py diff --git a/ugly_file.py b/ugly_file.py new file mode 100644 index 0000000000..de147438a2 --- /dev/null +++ b/ugly_file.py @@ -0,0 +1 @@ +print ( "hello") From 5dd412deb8ffbf2cfc4a5255a4e40065f1d257b9 Mon Sep 17 00:00:00 2001 From: Will Constable Date: Fri, 23 Feb 2024 16:16:34 -0800 Subject: [PATCH 5/6] Delete ugly_file --- ugly_file.py | 1 - 1 file changed, 1 deletion(-) delete mode 100644 ugly_file.py diff --git a/ugly_file.py b/ugly_file.py deleted file mode 100644 index de147438a2..0000000000 --- a/ugly_file.py +++ /dev/null @@ -1 +0,0 @@ -print ( "hello") From ab12352feefc7d4029c48f920325eb061113b271 Mon Sep 17 00:00:00 2001 From: Will Constable Date: Fri, 23 Feb 2024 16:18:12 -0800 Subject: [PATCH 6/6] change to py 3.10 to match unit_test --- .github/workflows/lint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 2644512e51..9d558d50ed 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.11'] + python-version: ['3.10'] steps: - name: Check out repo uses: actions/checkout@v3