-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature]: Aider-inspired linting functionality #2220
Comments
Fyi, started working on a PR to make use of Aider's Linter class within agentskills edit_file. |
What about also supporting pre-commit? That would allow linting to be more customizable and add an abstraction, so this project does not need to support all the linting systems. |
Pre-commit already has linting enabled. Here we are talking about linting of LLM-generated code. |
Yes, the generated code could be linted with pre-commit before it being run. |
That's an interesting approach for sure. Does it install dependencies by file extention, for example? |
We can make it do it if we configure all the languages. However, by configuring all the languages, I guess the issue is the time it will take to set up the virtual environment with all the linters.
For example, ours is quite advanced: but some can be simpler: I like that it standardizes the way to run them, and most are already integrated with it: |
@jeremi I love this idea! Overall one big philosophy of OpenDevin is that we want to re-use the tools that already exist for software development, and pre-commit is exactly that sort of tool. |
I'm working on integrating the aider linter, and with Python code everything works fine. But was also trying to get fixes with non-Python code. For example, with ruby code, the linter detects the error, and creates an ipythoncellobservation indicating there is a syntax error, but the agent does not actually provide the correct fix -- it just repeats the code with poor syntax. Any ideas?
In python, with similar level of hints in the observation, it just makes the fix. Any ideas on how to correct this? Is multi-language support needed? |
Updated aider linter to: * Always return text and line numbers * Moved extract line number more consistently * Changed pylint to stop after first linter detects errors Updated agentskills * To get back a LintResult object and then use lines and text for error message and related line number * Moved code for extracting line number to aider linter Tests: * Added additional unit tests for aider to test for * Return values from lint failures * Confirm linter works for non-configured languages like Ruby
cc @neubig please also see #2489 which @JeffKatzy has been working on for a while. |
Updated aider linter to: * Always return text and line numbers * Moved extract line number more consistently * Changed pylint to stop after first linter detects errors Updated agentskills * To get back a LintResult object and then use lines and text for error message and related line number * Moved code for extracting line number to aider linter Tests: * Added additional unit tests for aider to test for * Return values from lint failures * Confirm linter works for non-configured languages like Ruby
Updated aider linter to: * Always return text and line numbers * Moved extract line number more consistently * Changed pylint to stop after first linter detects errors Updated agentskills * To get back a LintResult object and then use lines and text for error message and related line number * Moved code for extracting line number to aider linter Tests: * Added additional unit tests for aider to test for * Return values from lint failures * Confirm linter works for non-configured languages like Ruby
Updated aider linter to: * Always return text and line numbers * Moved extract line number more consistently * Changed pylint to stop after first linter detects errors Updated agentskills * To get back a LintResult object and then use lines and text for error message and related line number * Moved code for extracting line number to aider linter Tests: * Added additional unit tests for aider to test for * Return values from lint failures * Confirm linter works for non-configured languages like Ruby
…2489) * WIP for integrate aider linter, see OpenDevin#2220 Updated aider linter to: * Always return text and line numbers * Moved extract line number more consistently * Changed pylint to stop after first linter detects errors Updated agentskills * To get back a LintResult object and then use lines and text for error message and related line number * Moved code for extracting line number to aider linter Tests: * Added additional unit tests for aider to test for * Return values from lint failures * Confirm linter works for non-configured languages like Ruby * move to agent_skills, fixes not seeing skills error * format/lint to new code, fix failing tests, remove unused code from aider linter * small changes (remove litellm, fix readme typo) * fix failing sandbox test * keep, change dumping of metadata * WIP for integrate aider linter, see OpenDevin#2220 Updated aider linter to: * Always return text and line numbers * Moved extract line number more consistently * Changed pylint to stop after first linter detects errors Updated agentskills * To get back a LintResult object and then use lines and text for error message and related line number * Moved code for extracting line number to aider linter Tests: * Added additional unit tests for aider to test for * Return values from lint failures * Confirm linter works for non-configured languages like Ruby * move to agent_skills, fixes not seeing skills error * format/lint to new code, fix failing tests, remove unused code from aider linter * remove duplication of tree-sitter, grep-ast and update poetry.lock * revert to main branch poetry.lock version * only update necessary package * fix jupyter kernel wrong interpreter issue (only for swebench) * fix failing lint tests * update syntax error checks for flake * update poetry lock file * update poetry.lock file, which update content-hash * add grep ast * remove extra stuff caused by merge * update pyproject * remove extra pytest fixture, ruff styling fixes * lint files * update poetry.lock file --------- Co-authored-by: Jeff Katzy <[email protected]> Co-authored-by: yufansong <[email protected]> Co-authored-by: Xingyao Wang <[email protected]> Co-authored-by: Xingyao Wang <[email protected]> Co-authored-by: tobitege <[email protected]>
Fixed by #2489 ! |
What problem or use case are you trying to solve?
Aider has functionality for linting code in multiple languages that could be helpful for OpenDevin.
Describe the UX of the solution you'd like
It would be good if OpenDevin agents (optionally?) linted the code they generated so that they could create code that passes basic syntax and style checks.
Do you have thoughts on the technical implementation?
Currently OpenDevin supports some rudimentary linting.
In contrast, Aider's linting has a number of good points that OpenDevin does not yet support:
We may want to take some inspiration from their work, either by importing the library wholesale and replacing our current agentskills implementation with theirs, or more piecemeal.
Additional context
Aider article on swe-bench lite.
Aider super-issue #120
The text was updated successfully, but these errors were encountered: