mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 01:35:00 +00:00
copy
This commit is contained in:
parent
cf93869d3f
commit
2a8bb715f0
1 changed files with 27 additions and 0 deletions
|
@ -29,6 +29,33 @@ This is how most linters normally operate.
|
|||
By default, aider will lint any files which it edits.
|
||||
You can disable this with the `--no-auto-lint` switch.
|
||||
|
||||
### Per-language linters
|
||||
|
||||
To specify different linters based on the code language, use `--lint "language: cmd"`.
|
||||
|
||||
### Code formatting "linters"
|
||||
|
||||
Many people use code formatters as linters, to format and pretty their code.
|
||||
These tools sometimes return non-zero exit codes if they make changes, which will
|
||||
confuse aider into thinking there's an actual lint error that needs to be fixed.
|
||||
|
||||
You can use formatters by wrapping them in a shell script like this and setting
|
||||
the script as your linter.
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
|
||||
# Run it twice.
|
||||
#
|
||||
# First attempt may reformat/modify files, and therefore exit with non-zero status.
|
||||
#
|
||||
# Second attempt will not do anything and exit 0 unless there's a real problem beyond
|
||||
# the code formatting that was completed.
|
||||
|
||||
pre-commit run --files $* >/dev/null \
|
||||
|| pre-commit run --files $*
|
||||
```
|
||||
|
||||
## Testing
|
||||
|
||||
You can run tests with `/test <test-command>`.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue