Skip to content

Commit

Permalink
Merge pull request #78 from deepset-ai/lint-samples
Browse files Browse the repository at this point in the history
Lint `sample_components` in CI
  • Loading branch information
ZanSara authored Aug 10, 2023
2 parents 5c8d0e2 + 5b2ffd3 commit 3fb71f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 26 deletions.
29 changes: 3 additions & 26 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Mypy
run: |
mkdir .mypy_cache/
mypy --install-types --non-interactive --ignore-missing-imports canals/
mypy --install-types --non-interactive --ignore-missing-imports canals/ sample_components/
pylint:
runs-on: ubuntu-latest
Expand All @@ -51,7 +51,7 @@ jobs:
pip install .[mermaid,graphviz,dev]
- name: Pylint
run: pylint -ry -j 0 canals/
run: pylint -ry -j 0 canals/ sample_components/

black:
runs-on: ubuntu-latest
Expand All @@ -68,30 +68,7 @@ jobs:
run: pip install .[dev]

- name: Check status
run: |
if ! black canals/ --check; then
git status
echo "###################################################################################################"
echo "# "
echo "# CHECK FAILED! Black found issues with your code formatting."
echo "# "
echo "# Either:"
echo "# 1. Run Black locally before committing:"
echo "# "
echo "# pip install .[dev]"
echo "# black ."
echo "# "
echo "# 2. Install the pre-commit hook:"
echo "# "
echo "# pre-commit install --hook-type pre-push"
echo "# "
echo "# 3. See /~https://github.com/deepset-ai/canals/blob/main/CONTRIBUTING.md for help."
echo "# "
echo "# If you have further problems, please open an issue: /~https://github.com/deepset-ai/canals/issues"
echo "# "
echo "##################################################################################################"
exit 1
fi
run: black canals/ --check

tests:
name: Unit / Python ${{ matrix.version }} / ${{ matrix.os }}
Expand Down
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ repos:
rev: 'v1.1.1'
hooks:
- id: mypy
exclude: ^test/
args: [--ignore-missing-imports]
additional_dependencies: ['types-requests']

Expand Down

0 comments on commit 3fb71f8

Please sign in to comment.