From b815d086f0a6039958deccc54be8fcd08e629e5e Mon Sep 17 00:00:00 2001 From: James Maslek Date: Fri, 15 Dec 2023 05:00:25 -0500 Subject: [PATCH] separate pylint between platform + terminal (#5892) * separate pylint b/w platform + terminal * Explicitly set pylint check scope to files in the diff --------- Co-authored-by: Theodore Aptekarev --- .github/workflows/linting.yml | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 29e2e0cf3fd..8108d55c62c 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -37,10 +37,12 @@ jobs: python-version: "3.9" architecture: x64 - - name: Get changed files in openbb_terminal for PR + - name: Get changed files in openbb_terminal and openbb_platform for PR if: github.event_name == 'pull_request' run: | - echo "files=$(git diff --name-only origin/${{ github.base_ref }}...${{ github.head_ref }} | grep 'openbb_terminal/.*\.py$' | xargs)" >> $GITHUB_ENV + # "Checking PR diff" + echo "terminal_files=$(git diff --name-only origin/${{ github.base_ref }}...${{ github.head_ref }} | grep 'openbb_terminal/.*\.py$' | xargs)" >> $GITHUB_ENV + echo "platform_files=$(git diff --name-only origin/${{ github.base_ref }}...${{ github.head_ref }} | grep 'openbb_platform/.*\.py$' | grep -v 'openbb_platform/openbb/package' | grep -v 'integration' | grep -v 'tests' | xargs)" >> $GITHUB_ENV - uses: actions/cache@v3 with: @@ -56,12 +58,21 @@ jobs: - run: codespell --ignore-words=.codespell.ignore --skip="$(tr '\n' ',' < .codespell.skip | sed 's/,$//')" --quiet-level=2 - run: ruff . - run: | - if [ -n "${{ env.files }}" ]; then - mypy --ignore-missing-imports ${{ env.files }} + # Run linters for openbb_terminal + if [ -n "${{ env.terminal_files }}" ]; then + mypy --ignore-missing-imports ${{ env.terminal_files }} + pylint terminal.py ${{ env.terminal_files }} else echo "No Python files changed in openbb_terminal" fi - - run: pylint terminal.py openbb_terminal tests + - run: | + # Run linters for openbb_platform + if [ -n "${{ env.platform_files }}" ]; then + # Add mypy to this part of the linting workflow once we're ready + pylint ${{ env.platform_files }} + else + echo "No Python files changed in openbb_platform" + fi markdown-link-check: name: Markdown Linting