.NET: Linter runner doesn't work
Issue
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
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.
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
I believe dotnet build is a quite comprehensive make/compile/build command. Not a linter.
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).
Using aider --test-cmd "dotnet build" might make more sense.
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.
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:
- Call a shell script that invokes
dotnet buildand ignores the args. Requires no aider changes. - Add an option to not pass the file name to the linter command.
So the model for aider is that the lint step is something which is done to specific files which have been edited. So it's expected to take the filename(s) of source files on the cmd line.
The test step is a "global" operation, not applied to specific file.
Why not do --test-cmd "dotnet build && dotnet test" to both build and test?
Why not do --test-cmd "dotnet build && dotnet test" to both build and test?
@paul-gauthier Paul, because it's not the same operations :) Build is a build and test is a test) it's often when a project doesn't even have any tests.
Many languages have a build/compile feature and it'll be nice to see support of building in aider. If you wish I can even implement it...
It's called --test-cmd but it doesn't need to be used for testing. It's just used for any repo-wide checks that you want aider to do. For many projects, that's testing. It could be building. Or it could be both building and testing. Whatever you like for your project.
There's no need for a separate --build-cmd. That just adds complexity and I don't think it does anything more than using --test-cmd for any/all repo-wide checks.
I'm going to close this issue for now, but feel free to add a comment here and I will re-open or file a new issue any time.