Skip to content

Commit

Permalink
Implement pyright linting (#81)
Browse files Browse the repository at this point in the history
* Add pyright static linter

Signed-off-by: Jose Luis Rivero <[email protected]>
  • Loading branch information
j-rivero authored Feb 27, 2024
1 parent 206aa7a commit d5aa161
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/pyright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: CI
on: [push]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5
with:
cache: 'pip'
- run: |
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
- run: echo "$PWD/.venv/bin" >> $GITHUB_PATH
- uses: jakebailey/pyright-action@1a4bf406072a8d0efdf6faba94a34a096430472f # v2
9 changes: 6 additions & 3 deletions plugins/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,17 @@ def load_config_file(config_file_path='config/repository.yaml'):


def load_project(project, config):
ret = []
for p in config['projects']:
pattern = re.compile(p['name'])
if pattern.search(project):
return p['repositories']
# stop in the first match
ret = p['repositories']
break

error('Unknown project: ' + project)
if not ret:
error('Unknown project: ' + project)

return ret


def get_linux_distro():
Expand Down

0 comments on commit d5aa161

Please sign in to comment.