gollm

Validation Rules

Overview

Validation rules define the code quality standards enforced by goLLM. These rules help maintain consistent code quality across your project.

Core Validation Rules

Line Length

Function Length

File Length

Cyclomatic Complexity

Function Parameters

Code Style Rules

Global Variables

Docstrings

Type Hints

Naming Conventions

Example Configuration

{
  "validation_rules": {
    "max_function_lines": 50,
    "max_file_lines": 300,
    "max_cyclomatic_complexity": 10,
    "max_function_params": 5,
    "max_line_length": 88,
    "forbid_print_statements": true,
    "forbid_global_variables": true,
    "require_docstrings": true,
    "require_type_hints": false,
    "naming_convention": "snake_case"
  }
}

Customizing Rules

You can customize these rules by creating or modifying the gollm.json file in your project root. Run gollm validate to check your code against the current rules.

Rule Severity

Each rule can have one of the following severity levels:

Disabling Rules

To disable a specific rule, you can either:

  1. Set it to false in the configuration
  2. Or set its severity to "off"

Next Steps