line-count-limit¶
Limit file, function, and method length with optional path-specific settings.
Message¶
{target} has {actual_lines} lines, exceeding the configured limit of {max_lines}.
Settings¶
| Setting | Description | Type | Default |
|---|---|---|---|
| glob_limits | Glob-specific limit settings keyed by path glob. More specific matching globs override less specific matching globs. | dict | {} |
| max_file_lines | Maximum lines allowed in a file. Set to 0 to disable. | int | 0 |
| max_function_lines | Maximum lines allowed in top-level functions. Set to 0 to disable. | int | 0 |
| max_method_lines | Maximum lines allowed in methods. Set to 0 to disable. | int | 0 |
| per_file_limits | Exact per-file limit settings keyed by repo-relative path. These override base settings and glob_limits. | dict | {} |
Valid examples¶
def small() -> None:
pass
class Service:
def small(self) -> None:
pass
Show more
def large() -> None:
pass
pass
Invalid examples¶
def oversized() -> None:
first()
second()
Show more
class Service:
def oversized(self) -> None:
first()
second()
one()
two()
three()