format_code
Automatically formats Fortran code with fprettify to enforce consistent indentation and spacing, improving readability and adhering to style guidelines.
Instructions
Auto-formats a string of Fortran code using fprettify to enforce modern indentation and spacing.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"code": "<code>"
},
"name": "format_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The Fortran code content to format. | |
| indent | No | Relative indentation width (default: 3). | |
| line_length | No | Column after which a line should end (default: 132). | |
| whitespace | No | Preset (0-4) for the amount of whitespace (default: 2). | |
| strict_indent | No | Strictly impose indentation even for nested loops (default: False). | |
| enable_decl | No | Enable whitespace formatting of declarations (default: False). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |