Adds ruff linting and formatting (#262)

This commit is contained in:
Gabriel Garrett
2023-12-08 11:30:55 -06:00
committed by GitHub
parent 6ac25db4be
commit 9b7fbbb4f2
6 changed files with 23 additions and 4 deletions
+8
View File
@@ -0,0 +1,8 @@
name: Ruff
on: [push, pull_request]
jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: chartboost/ruff-action@v1
+10
View File
@@ -0,0 +1,10 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.1.7
hooks:
# Run the linter.
- id: ruff
args: [ --fix ]
# Run the formatter.
- id: ruff-format
@@ -79,7 +79,7 @@ class TaskPlan(BaseModel):
tmp_dep_graph = {item.id: set(item.subtasks) for item in self.task_graph}
def topological_sort(
dep_graph: dict[int, set[int]]
dep_graph: dict[int, set[int]],
) -> Generator[set[int], None, None]:
while True:
ordered = set(item for item, dep in dep_graph.items() if len(dep) == 0)
+1 -1
View File
@@ -101,7 +101,7 @@ def delete(file_id: str = typer.Argument(..., help="ID of the file to delete")):
help="Monitor the status of a file on OpenAI's servers",
)
def status(
file_id: str = typer.Argument(..., help="ID of the file to check the status of")
file_id: str = typer.Argument(..., help="ID of the file to check the status of"),
):
with console.status(f"Monitoring status of file {file_id}...") as status:
while True:
+3 -1
View File
@@ -2,4 +2,6 @@ openai>=1.1.0
pydantic
docstring-parser
rich
aiohttp
aiohttp
ruff==0.1.7
pre-commit==3.5.0
@@ -1,4 +1,3 @@
from typing import Iterable
from openai import OpenAI
from pydantic import BaseModel, Field
from typing import List