Skip to content

Commit

Permalink
Add CI for linting
Browse files Browse the repository at this point in the history
  • Loading branch information
maxdymond committed Mar 5, 2024
1 parent f8e890f commit ed40626
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 2 deletions.
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: pip
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Lint

on: [push]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r dev-requirements.txt
- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py')
- name: Analysing the code with mypy
run: |
mypy $(git ls-files '*.py')
5 changes: 5 additions & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

pylint
mypy
4 changes: 2 additions & 2 deletions function_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ def blob_trigger(newfile: func.InputStream):

@app.function_name(name="eventGridTrigger")
@app.event_grid_trigger(arg_name="event")
def eventGridTrigger(event: func.EventGridEvent):
"""Process an event grid trigger for a new blob in the container"""
def event_grid_trigger(event: func.EventGridEvent):
"""Process an event grid trigger for a new blob in the container."""
log.info("Processing event %s", event.id)
rm = RepoManager()
rm.check_metadata()
Expand Down

0 comments on commit ed40626

Please sign in to comment.