---
title: "file-length-limit"
description: "Limit source-file length."
image: "https://strider.gempir.com/og.png"
---

> Documentation Index
> Fetch the complete documentation index at: https://strider.gempir.com/llms.txt
> Use this file to discover all available pages before exploring further.

# file-length-limit

**Default severity:** `note`

Limits source-file length. The built-in maximum is 500 lines.

For example, with `max-lines = 5`, a six-line source file is reported while a
five-line file is accepted.

## Bad

```go
package example

const first = 1
const second = 2
const third = 3
const fourth = 4
```

## Good

```go
package example

const first = 1
const second = 2
const third = 3
```

## Configuration

| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `max-lines` | `int` | `500` | Maximum number of lines allowed in a source file; zero disables the limit. |

```toml
[checks.file-length-limit]
max-lines = 500
```

Source: https://strider.gempir.com/lints/file-length-limit/index.mdx
