Skip to content

Commit

Permalink
Add gh action to lint python
Browse files Browse the repository at this point in the history
  • Loading branch information
emgeee committed Nov 13, 2024
1 parent 4e547f9 commit 42d9caa
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 4 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/python-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Ruff Linting

on:
push:
branches: [ "main" ]
paths:
- 'py-denormalized/**' # Only trigger on changes in this directory
pull_request:
branches: [ "main" ]
paths:
- 'py-denormalized/**' # Only trigger on changes in this directory
workflow_dispatch:

jobs:
lint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: py-denormalized # Set the working directory for all run steps

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: 'pip'

- name: Install Ruff
run: pip install ruff

- name: Run Ruff
# Ruff will look for pyproject.toml in the py-denormalized directory
run: |
# Run Ruff linter
ruff check .
# Run Ruff formatter
ruff format . --check
4 changes: 2 additions & 2 deletions py-denormalized/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ dev-dependencies = [

# Enable docstring linting using the google style guide
[tool.ruff.lint]
select = ["E4", "E7", "E9", "F", "D", "W"]
ignore = ["D103"]
# select = ["E4", "E7", "E9", "F", "D", "W"]
ignore = ["F", "D100", "D101", "D102", "D103", "D107"]

[tool.ruff.lint.pydocstyle]
convention = "google"
Expand Down
1 change: 0 additions & 1 deletion py-denormalized/python/denormalized/feast_data_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import pyarrow as pa
from denormalized._d_internal import PyDataStream
from denormalized.datafusion import Expr
from feast import FeatureStore, Field
from feast.data_source import PushMode
from feast.type_map import pa_to_feast_value_type
Expand Down
1 change: 0 additions & 1 deletion py-denormalized/python/examples/udaf_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

from denormalized import Context
from denormalized.datafusion import Accumulator, col
from denormalized.datafusion import functions as f
from denormalized.datafusion import udaf


Expand Down

0 comments on commit 42d9caa

Please sign in to comment.