diff --git a/.github/workflows/flake8_python_linter.yml b/.github/workflows/flake8_python_linter.yml deleted file mode 100644 index 3c52466ca..000000000 --- a/.github/workflows/flake8_python_linter.yml +++ /dev/null @@ -1,42 +0,0 @@ -# This workflow runs flake8 with reviewdog. The documentation can be found below: -# https://github.com/marketplace/actions/run-flake8-with-reviewdog -# Flake8 is a Python linter that analyzes code and checks for programming and stylistic errors -name: Flake8 Linter - -# This workflow acts only on pull requests -on: pull_request - -jobs: - - flake8-lint: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.11", "3.12"] - - steps: - - name: Check out source repository - uses: actions/checkout@v2 - - - name: Set up Python environment - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Flake8 Lint - uses: reviewdog/action-flake8@v3 - with: - # For more flake 8 arguments, visit the link below: - # https://flake8.pycqa.org/en/latest/user/options.html - # Currently, flake8 ignores the following; - # E202: Whitespace before ')' - # E203: Whitespace before ':' - # E221: Multiple spaces before operator - # E241: Multiple spaces after ',' - # E251: Unexpected spaces around keyword / parameter equals - # E272: Multiple spaces before keyword - flake8_args: "--ignore=W503,E202,E203,E221,E241,E251,E272,E126,E131,E121,E111,E127 - --max-line-length 120 - --exclude python/react-series-data-viewer/protocol_buffers/ - --exclude Loris " - github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml new file mode 100644 index 000000000..75afad511 --- /dev/null +++ b/.github/workflows/python.yml @@ -0,0 +1,54 @@ +# This workflow runs flake8 with reviewdog. The documentation can be found below: +# https://github.com/marketplace/actions/run-flake8-with-reviewdog +# Flake8 is a Python linter that analyzes code and checks for programming and stylistic errors +name: Flake8 Linter + +# This workflow acts only on pull requests +on: pull_request + +jobs: + + setup: + runs-on: ubuntu-latest + + strategy: + matrix: + python-version: ["3.11", "3.12"] + + steps: + - name: Check out source repository + uses: actions/checkout@v4 + + - name: Set up Python environment + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install Python dependencies + run: pip install -r python/requirements.txt + + ruff: + runs-on: ubuntu-latest + needs: setup + + steps: + - name: Run Ruff + run: ruff check + + pyright-strict: + runs-on: ubuntu-latest + needs: setup + + steps: + - name: Run Pyright + run: pyright + + pyright-loose: + runs-on: ubuntu-latest + needs: setup + + steps: + - name: Run Pyright + run: | + cd test + pyright