Skip to content
This repository was archived by the owner on Feb 11, 2026. It is now read-only.

Commit 7004a04

Browse files
Fix lint checks so they trigger on PR builds
This involves: - Adding missing `status-checks.yml` file - Adding missing `requirements-dev.txt` file - Temporarily disabling `pylint` and `mypy` due to nonexistent Python code at this point - Moving `mergify.yml` to the proper directory Signed-off-by: Courtney Pacheco <6019922+courtneypacheco@users.noreply.github.com>
1 parent bb90516 commit 7004a04

File tree

5 files changed

+96
-9
lines changed

5 files changed

+96
-9
lines changed

.github/workflows/lint.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,17 @@ jobs:
4646
- name: "ruff"
4747
commands: |
4848
tox -e ruff
49-
- name: "pylint"
50-
commands: |
51-
echo "::add-matcher::.github/workflows/matchers/pylint.json"
52-
tox -e fastlint
53-
tox -e lint
54-
- name: "mypy"
55-
commands: |
56-
echo "::add-matcher::.github/workflows/matchers/mypy.json"
57-
tox -e mypy
49+
## TODO: Uncomment `pylint` once the first in-house, Python-based action is merged
50+
# - name: "pylint"
51+
# commands: |
52+
# echo "::add-matcher::.github/workflows/matchers/pylint.json"
53+
# tox -e fastlint
54+
# tox -e lint
55+
## TODO: Uncomment `mypy` once the first in-house, Python-based action is merged
56+
# - name: "mypy"
57+
# commands: |
58+
# echo "::add-matcher::.github/workflows/matchers/mypy.json"
59+
# tox -e mypy
5860
- name: "yamllint"
5961
commands: |
6062
tox -e yamllint
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# yamllint disable rule:line-length
3+
4+
name: Status Checks Reusable Workflow
5+
6+
on:
7+
workflow_call:
8+
inputs:
9+
job_ids:
10+
description: 'Space-separated job ids to wait on for status checks'
11+
required: true
12+
type: string
13+
delay:
14+
description: 'Period in seconds to wait before first poll of GitHub Check Runs'
15+
required: false
16+
type: number
17+
default: 10
18+
interval:
19+
description: 'Interval or period in seconds between polling GitHub Check Runs'
20+
required: false
21+
type: number
22+
default: 10
23+
timeout:
24+
description: 'Timeout in seconds to complete polling GitHub Check Runs'
25+
required: false
26+
type: number
27+
default: 3600
28+
29+
env:
30+
LC_ALL: en_US.UTF-8
31+
32+
defaults:
33+
run:
34+
shell: bash
35+
36+
permissions:
37+
checks: read
38+
39+
jobs:
40+
status-checks:
41+
runs-on: ubuntu-latest
42+
steps:
43+
- name: "Harden Runner"
44+
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
45+
with:
46+
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
47+
48+
- name: "Set status check variables"
49+
id: set_variables
50+
run: |
51+
jq -nr '[$ARGS.positional[] | split("\\s"; null) | map(select(. != ""))] | flatten | join("|") | ("match_pattern=(" + . + ")")' --args "${{ inputs.job_ids }}" >> "$GITHUB_OUTPUT"
52+
53+
- name: "Wait for status checks"
54+
uses: poseidon/wait-for-status-checks@899c768d191b56eef585c18f8558da19e1f3e707 # v0.6.0
55+
with:
56+
token: ${{ secrets.GITHUB_TOKEN }}
57+
match_pattern: ${{ steps.set_variables.outputs.match_pattern }}
58+
delay: ${{ inputs.delay }}
59+
interval: ${{ inputs.interval }}
60+
timeout: ${{ inputs.timeout }}

requirements-dev.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
pydeps>=1.12.12,<2
4+
pylint>=2.16.2,<4.0
5+
pylint-pydantic
6+
pytest
7+
pytest-asyncio
8+
pytest-cov
9+
pytest-html
10+
tox>=4.4.2,<5

tox.ini

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,24 @@ deps =
2828
pytest
2929
pylint>=2.16.2,<4.0
3030
pylint-pydantic
31+
## TODO: Update directories from `src/` and `test/` so the proper dirs can be linted
3132
commands =
3233
{envpython} -m pylint --load-plugins pylint_pydantic src/ tests/
3334

35+
[testenv:fastlint]
36+
description = fast lint with pylint (without 3rd party modules)
37+
basepython = {[testenv:py3]basepython}
38+
labels = fastverify
39+
skip_install = true
40+
skipsdist = true
41+
deps = {[testenv:lint]deps}
42+
## TODO: Update directories from `src/` and `test/` so the proper dirs can be linted
43+
commands =
44+
{envpython} -m pylint \
45+
--load-plugins pylint_pydantic \
46+
--disable=import-error \
47+
src/ tests/
48+
3449
[testenv:ruff]
3550
description = lint and format check with ruff
3651
basepython = {[testenv:py3]basepython}

0 commit comments

Comments
 (0)