Skip to content

Commit

Permalink
ci: parametrize source folder (#228)
Browse files Browse the repository at this point in the history
* ci: parametrize source folder
* Apply suggestions from code review
  • Loading branch information
Borda authored Feb 27, 2024
1 parent d5b894c commit cb95b39
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/check-typing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ on:
default: "3.9"
required: false
type: string
source-dir:
description: "Source directory to check"
default: "src/"
required: false
type: string
extra-typing:
description: "Package extra to be installed for type checks + include mypy"
default: "test"
Expand Down Expand Up @@ -56,7 +61,7 @@ jobs:
unfold: true

# see: https://github.com/python/mypy/issues/10600#issuecomment-857351152
- run: yes | mypy src --install-types || true
- run: yes | mypy . --install-types || true

- name: Check typing
# mypy uses the config file found in the following order:
Expand All @@ -71,12 +76,14 @@ jobs:

- name: suggest ignores
if: failure()
env:
SOURCE_DIR: ${{ inputs.source-dir }}
run: |
mypy --no-error-summary 2>&1 \
| tr ':' ' ' \
| awk '{print $1}' \
| sort \
| uniq \
| sed 's/\.py//g; s|src/||g; s|\/__init__||g; s|\/|\.|g' \
| sed 's/\.py//g; s|${SOURCE_DIR}||g; s|\/__init__||g; s|\/|\.|g' \
| xargs -I {} echo '"{}",' \
|| true
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

-
- CI: parametrize source folder for typing check ([#228](https://github.com/Lightning-AI/utilities/pull/228))


### Deprecated
Expand Down

0 comments on commit cb95b39

Please # to comment.