Skip to content

Commit

Permalink
feat: add ruff formatting check (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
EpsilonPrime authored Apr 5, 2024
1 parent b8601ec commit 961ce89
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Ruff

on: [push]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: "latest"
activate-environment: base
environment-file: environment.yml
python-version: ${{ matrix.python }}
auto-activate-base: true
- name: Analyzing the code using ruff
uses: chartboost/ruff-action@v1
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ dependencies:
- Faker
- pip:
- adbc_driver_manager
- cargo
- pyarrow
- duckdb == 0.10.1
- datafusion
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ target-version = "py310"
# never autoformat upstream or generated code
exclude = ["third_party/", "src/spark/connect"]
# do not autofix the following (will still get flagged in lint)

[lint]
unfixable = [
"F401", # unused imports
"T201", # print statements
Expand Down
1 change: 1 addition & 0 deletions src/gateway/demo/client_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@


# pylint: disable=fixme
# ruff: noqa: E712
def execute_query(spark_session: SparkSession) -> None:
"""Runs a single sample query against the gateway."""
users_location = str(Path('users.parquet').absolute())
Expand Down
1 change: 1 addition & 0 deletions src/gateway/tests/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@


# pylint: disable=missing-function-docstring
# ruff: noqa: E712
class TestDataFrameAPI:
"""Tests of the dataframe side of SparkConnect."""

Expand Down

0 comments on commit 961ce89

Please sign in to comment.