Skip to content

Commit 2c82d44

Browse files
committed
Rename to analyze-project.yml and 'extras'
1 parent 156d9b4 commit 2c82d44

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed
Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Check analyzers
22
description: >
3-
This workflow checks the code quality of a Python package using various
3+
This workflow checks the code quality of a Python project using various
44
analyzers like linters and type checkers, including ni-python-styleguide,
55
mypy, bandit, and pyright. It is designed to be reusable across different
66
projects and can be easily integrated into existing CI/CD pipelines.
@@ -11,8 +11,9 @@ on:
1111
project-directory:
1212
description: Path to the directory containing pyproject.toml.
1313
default: ${{ github.workspace }}
14-
install-extras:
15-
description: 'List of Poetry extras to install (comma separated)'
14+
extras:
15+
# E.g. "docs drivers"
16+
description: 'List of Poetry extras to install (separated by spaces)'
1617
default: ''
1718
required: false
1819
type: string
@@ -53,7 +54,11 @@ jobs:
5354
- name: Install ${{ steps.get_package_info.outputs.name }}
5455
run: |
5556
if [ "${{ inputs.install-extras }}" != "" ]; then
56-
poetry install -v --extras "${{ inputs.install-extras }}"
57+
EXTRAS_ARGS=""
58+
for extra in ${{ inputs.extras }}; do
59+
EXTRAS_ARGS="$EXTRAS_ARGS -E $extra"
60+
done
61+
poetry install -v $EXTRAS_ARGS
5762
else
5863
poetry install -v
5964
fi
@@ -63,8 +68,9 @@ jobs:
6368
run: poetry run mypy
6469
- name: Mypy static analysis (Windows)
6570
run: poetry run mypy --platform win32
71+
# Assumes there are 'targets' in pyproject.toml for Bandit
6672
- name: Bandit security checks
67-
run: poetry run bandit -c pyproject.toml -r src/
73+
run: poetry run bandit -c pyproject.toml -r
6874
- name: Add virtualenv to the path for pyright-action
6975
run: echo "$(poetry env info --path)/bin" >> $GITHUB_PATH
7076
- name: Pyright static analysis (Linux)

0 commit comments

Comments
 (0)