File must be at most max_bytes in size. Catches accidental large-blob commits.
Options
Section titled “Options”| Option | Type | Required | Default | Description |
|---|---|---|---|---|
max_bytes | integer (>= 0) | yes | Maximum allowed file size in bytes. |
Plus the common paths, level, id, and when fields. This table is generated from the JSON Schema; option types and defaults are authoritative.
Example
Section titled “Example”A file over the byte limit
Section titled “A file over the byte limit”The rule fires on this repository:
big.txttiny.txtthis content is easily over ten bytes longshortWith this .alint.yml:
version: 1rules: - id: under-10-bytes kind: file_max_size paths: "**/*.txt" max_bytes: 10 level: warningalint check reports:
--- big.txt -------------------------------------------------------------------- ! warning under-10-bytes file exceeds 10 byte(s) (actual: 42)
Summary (1 violation): ! 1 warning 0 passing * 1 failingEvery file is under the byte limit
Section titled “Every file is under the byte limit”This repository is compliant:
also_tiny.txttiny.txthixWith this .alint.yml:
version: 1rules: - id: under-10-bytes kind: file_max_size paths: "**/*.txt" max_bytes: 10 level: warningalint check reports:
v All 1 rule(s) passed.