github-advanced-security[bot] commented on code in PR #2992: URL: https://github.com/apache/datafusion-ballista/pull/2992#discussion_r4743734611
########## .github/workflows/python-lint.yml: ########## @@ -0,0 +1,77 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# Ruff lints every Python file in the repository and the stub check covers +# ballista.proto, so this runs for changes to any of their inputs, not only +# for changes under python/. +name: Python lint + +on: + push: + branches: [ "main" ] + paths: + - "**/*.py" + - "**/pyproject.toml" + - "ruff.toml" + - "python/**" + - "ballista/core/proto/**" + - ".github/workflows/python-lint.yml" + pull_request: + paths: + - "**/*.py" + - "**/pyproject.toml" + - "ruff.toml" + - "python/**" + - "ballista/core/proto/**" + - ".github/workflows/python-lint.yml" + +concurrency: + group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} + cancel-in-progress: true + +jobs: + lint: + name: Lint Python and check generated gRPC stubs + runs-on: ubuntu-latest + steps: + - uses: actions/[email protected] + - uses: actions/setup-python@v7 + with: + python-version: "3.12" + - uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0 + with: + enable-cache: true + + # Use the --no-install-package to only install the dependencies + # but do not yet build the rust library + - name: Install dependencies + run: | + cd python + uv sync --dev --no-install-package ballista + + # Update output format to enable automatic inline annotations. + - name: Run Ruff + run: | + cd python + uv run --no-project ruff check --output-format=github .. + uv run --no-project ruff format --check .. + + - name: Check generated Python gRPC stubs are up to date + run: | + cd python + uv run --no-project ./dev/generate_proto.sh + git diff --exit-code -- python/ballista/proto Review Comment: ## CodeQL / Workflow does not contain permissions Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {{contents: read}} [Show more details](https://github.com/apache/datafusion-ballista/security/code-scanning/72) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
