Skip to content

neubig/openhands-linting-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Linting Error Analysis and Fix Automation

This repository contains scripts to analyze linting errors from GitHub Actions and dispatch jobs to fix them using the OpenHands Cloud API.

Files

  • linting_logs.txt: Raw logs from the GitHub Actions linting job
  • parse_linting_errors.py: Script to analyze linting errors and identify the top files and directories with errors
  • top_directories.txt: List of directories with the most linting errors
  • dispatch_linting_jobs.py: Script to dispatch jobs to fix linting errors using the OpenHands Cloud API
  • linting_prompt.jinja2: Template for the prompt to fix linting errors
  • dispatched_jobs.json: Information about the dispatched jobs

Analysis Results

The analysis identified the following top directories with linting errors:

  1. openhands/cli (113 errors)
  2. openhands/runtime (86 errors)
  3. openhands/server/routes (79 errors)
  4. openhands/utils (70 errors)
  5. openhands/server (52 errors)
  6. openhands/runtime/impl/remote (32 errors)
  7. openhands/server/session (31 errors)
  8. openhands/llm (31 errors)
  9. openhands/runtime/impl/docker (26 errors)
  10. openhands/runtime/impl/local (18 errors)

The top files with the most linting errors are:

  1. openhands/cli/tui.py (67 errors)
  2. openhands/runtime/action_execution_server.py (67 errors)
  3. openhands/runtime/impl/remote/remote_runtime.py (32 errors)
  4. openhands/runtime/impl/docker/docker_runtime.py (26 errors)
  5. openhands/llm/llm.py (24 errors)

Usage

1. Analyze Linting Errors

python3 parse_linting_errors.py

This will analyze the linting logs and output the top files and directories with linting errors.

2. Dispatch Jobs to Fix Linting Errors

First, set your OpenHands API key:

export OPENHANDS_API_KEY=your_api_key

Then run the script to dispatch jobs:

python3 dispatch_linting_jobs.py

This will dispatch jobs to fix linting errors in the top 10 directories with the most errors.

Notes

  • The scripts are designed to work with the OpenHands Cloud API.
  • The linting prompt template is configured to fix mypy typing errors in the specified directories.
  • Jobs are dispatched as draft PRs to the feature/fix-linting-errors branch.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors