Skip to content

Commit

Permalink
Merge pull request #23 from dexhunter/feat/lint
Browse files Browse the repository at this point in the history
🚨 add linter workflow and fix issues
  • Loading branch information
dexhunter authored Nov 22, 2024
2 parents 86339ec + 8d7fe7c commit 0fd5e9a
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 11 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Linter

on:
- push
- pull_request

jobs:
lint-python:
name: ruff
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
steps:
- name: Checkout Code
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install Ruff
run: pip install ruff==0.7.1
- name: Run Ruff
run: ruff check --output-format=github aide/
5 changes: 1 addition & 4 deletions aide/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
from dataclasses import dataclass

from .backend import compile_prompt_to_md

from .agent import Agent
from .interpreter import Interpreter
from .journal import Journal, Node
from .journal import Journal
from omegaconf import OmegaConf
from rich.status import Status
from .utils.config import load_task_desc, prep_agent_workspace, save_run, _load_cfg, prep_cfg
from pathlib import Path

@dataclass
class Solution:
Expand Down
2 changes: 1 addition & 1 deletion aide/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from typing import Any, Callable, cast

import humanize
from .backend import FunctionSpec, compile_prompt_to_md, query
from .backend import FunctionSpec, query
from .interpreter import ExecutionResult
from .journal import Journal, Node
from .utils import data_preview
Expand Down
6 changes: 3 additions & 3 deletions aide/backend/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

import jsonschema
from dataclasses_json import DataClassJsonMixin
import backoff
import logging
from typing import Callable

PromptType = str | dict | list
FunctionCallType = dict
OutputType = str | FunctionCallType


import backoff
import logging
from typing import Callable

logger = logging.getLogger("aide")

Expand Down
2 changes: 1 addition & 1 deletion aide/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def exception_summary(e, working_dir, exec_file_name, format_tb_ipython):
tb_lines = traceback.format_exception(e)
# skip parts of stack trace in weflow code
tb_str = "".join(
[l for l in tb_lines if "aide/" not in l and "importlib" not in l]
[line for line in tb_lines if "aide/" not in line and "importlib" not in line]
)
# tb_str = "".join([l for l in tb_lines])

Expand Down
2 changes: 0 additions & 2 deletions aide/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from . import backend

from .utils import tree_export
from .agent import Agent
from .interpreter import Interpreter
from .journal import Journal, Node
Expand All @@ -23,7 +22,6 @@
TimeRemainingColumn,
)
from rich.text import Text
from rich.markdown import Markdown
from rich.status import Status
from rich.tree import Tree
from .utils.config import load_task_desc, prep_agent_workspace, save_run, load_cfg
Expand Down

0 comments on commit 0fd5e9a

Please sign in to comment.