Code Linter
Code Linter reviews a piece of code and says whether it is well written or has syntax errors, such as an unclosed bracket. It is useful when a model generates code and you want to check it before using it.
When to use it
- Checking the code an agent writes before saving or running it.
- Asking an agent to fix its own code until it has no errors.
Configuration
| Field | What it does |
|---|---|
| Source Code | The code to review. |
| Programming Language | The code’s language: python (default), javascript, typescript, php, csharp, go, java, c, cpp, swift or kotlin. |
Output
The Lint Result output says whether the code is valid and, if not, where the errors are.
In tool mode, an agent can use the component by itself. See Tool Mode.
Example
A team uses an agent that writes small JavaScript scripts.
- Connect Code Linter in tool mode to the agent, with
javascriptin Programming Language. - In the agent’s instructions, ask it to check its code with the tool before handing it over.
Good practices
- It only checks syntax: code with no writing errors may still not do what you want.