paul-gauthier / aider

aider is AI pair programming in your terminal
https://aider.chat/
Apache License 2.0
12.58k stars 1.21k forks source link

.NET: Linter runner doesn't work #657

Open rodion-m opened 3 weeks ago

rodion-m commented 3 weeks ago

Issue

image dotnet build - is the correct linter command (it doesn't require to provide any files paths.

Version and model info

Aider v0.37.0 Models: claude-3-opus-20240229 with diff edit format, weak model claude-3-haiku-20240307 Git repo: .git with 33 files Repo-map: using 10000 tokens

paul-gauthier commented 2 weeks ago

Thanks for trying aider and filing this issue.

Does running dotnet build <filename> work for you if you just run it on the command line? That's all aider is doing.

rodion-m commented 2 weeks ago

Yeah, I understand. It's not working from cmd too. dotnet build accepts a solution or project path as an argument. C# and F# are compilable languages. So we need an ability for aider to make it to not inject anything into the command line. https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-build

paul-gauthier commented 1 week ago

I believe dotnet build is a quite comprehensive make/compile/build command. Not a linter.

rodion-m commented 1 week ago

You're right. An alternative true way is to make aider interact with the LSP (with its diagnostics), but it's much harder to implement and also not all IDEs use it. Anyway, I think the feature is a good candidate for a separate issue.

Speaking about dotnet build - yes, it's not a perfect option, but it works (I had to use it via tests with aider), so I believe we should allow developers to set this command as a linter command (or even add a new command).

paul-gauthier commented 1 week ago

Using aider --test-cmd "dotnet build" might make more sense.

rodion-m commented 1 week ago

Using aider --test-cmd "dotnet build" might make more sense.

Paul, but it's not tests. For tests we have dotnet test. What do you think about adding the 3-rd feature "building" or "compilation"? It can be like build-cmd.

nevercast commented 17 hours ago

Using aider --test-cmd "dotnet build" might make more sense.

This is what I wanted to use, but that does not work for me. In fact, trying to run any command with arguments does not work as I expect. Something wrong with the quoting.

https://github.com/paul-gauthier/aider/issues/741


Specifically, to this issue I see two obvious options:

  1. Call a shell script that invokes dotnet build and ignores the args. Requires no aider changes.
  2. Add an option to not pass the file name to the linter command.