Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Pylint
on:
workflow_dispatch:
push:
paths:
- '**.py'
branches:
- main
pull_request:
paths:
- '**.py'
branches:
- main

jobs:
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install global dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pylint
- name: Lint all functions
run: |
# Find all subdirectories in functions/ that contain Python files
for func_dir in functions/*/; do
if [ -d "$func_dir" ] && find "$func_dir" -name "*.py" -type f | grep -q .; then
func_name=$(basename "$func_dir")
echo "::group::Processing $func_name"

# Install function-specific dependencies if requirements.txt exists
if [ -f "$func_dir/requirements.txt" ]; then
echo "Installing dependencies for $func_name..."
pip install -r "$func_dir/requirements.txt"
else
echo "No requirements.txt found for $func_name, skipping dependency installation"
fi

# Run pylint on the function directory
echo "Running pylint on $func_name..."
pylint "$func_dir" --max-line-length=127 --disable=R0801 || {
echo "::error::Pylint failed for $func_name"
exit 1
}

echo "::endgroup::"
fi
done
Loading