Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .flake8

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/black.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/flake8.yml

This file was deleted.

29 changes: 29 additions & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Linting and formatting validation using ruff

on:
push:
branches: [main]
pull_request:

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
matrix:
python-version: ["3.13"]

steps:
- uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install -U pip
pip install -r requirements.txt
- name: Lint and check formatting with ruff
run: |
ruff check .
ruff format --check .
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ Start talking to the bot! Start a new DM or thread and click the feedback button

#### Linting
```zsh
# Run flake8 from root directory for linting
flake8 *.py && flake8 listeners/
# Run ruff check from root directory for linting
ruff check

# Run black from root directory for code formatting
black .
# Run ruff format from root directory for code formatting
ruff format
```

## Project Structure
Expand Down
4 changes: 3 additions & 1 deletion ai/llm_caller.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,7 @@ def call_llm(
openai_client = openai.OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
messages = [{"role": "system", "content": system_content}]
messages.extend(messages_in_thread)
response = openai_client.responses.create(model="gpt-4o-mini", input=messages, stream=True)
response = openai_client.responses.create(
model="gpt-4o-mini", input=messages, stream=True
)
return response
7 changes: 6 additions & 1 deletion listeners/views/feedback_block.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
from typing import List

from slack_sdk.models.blocks import Block, ContextActionsBlock, FeedbackButtonObject, FeedbackButtonsElement
from slack_sdk.models.blocks import (
Block,
ContextActionsBlock,
FeedbackButtonObject,
FeedbackButtonsElement,
)


def create_feedback_block() -> List[Block]:
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[tool.black]
line-length = 125
[tool.ruff]
[tool.ruff.lint]
[tool.ruff.format]

[tool.pytest.ini_options]
testpaths = ["tests"]
Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ slack-bolt==1.26.0
openai

pytest
flake8
black
ruff==0.14.0
python-dotenv==1.1.1