Skip to content

Merge branch 'main' into openhands/fix-issue-81 #36

Merge branch 'main' into openhands/fix-issue-81

Merge branch 'main' into openhands/fix-issue-81 #36

Workflow file for this run

name: Pylint
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint pyyaml
- name: Determine changed Python files
id: diff
shell: bash
run: |
set -euo pipefail
git fetch origin main --depth=1 || true
CHANGED=$(git diff --name-only origin/main...HEAD | grep -E '\.py$' || true)
echo "files<<EOF" >> "$GITHUB_OUTPUT"
echo "$CHANGED" >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
if [ -n "$CHANGED" ]; then
echo "any=true" >> "$GITHUB_OUTPUT"
else
echo "any=false" >> "$GITHUB_OUTPUT"
fi
- name: Analysing the code with pylint (changed files only)
if: steps.diff.outputs.any == 'true'
shell: bash
run: |
set -euo pipefail
echo "Changed Python files:"
printf "%s\n" "${{ steps.diff.outputs.files }}"
# Lint only errors; ignore refactor/convention/warning categories
printf "%s\n" "${{ steps.diff.outputs.files }}" | xargs -r pylint --disable=C,R,W