Skip to content

file_max_size

File must be at most max_bytes in size. Catches accidental large-blob commits.

OptionTypeRequiredDefaultDescription
max_bytesinteger (>= 0)yesMaximum 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.

The rule fires on this repository:

big.txt
tiny.txt
big.txt
this content is easily over ten bytes long
tiny.txt
short

With this .alint.yml:

version: 1
rules:
- id: under-10-bytes
kind: file_max_size
paths: "**/*.txt"
max_bytes: 10
level: warning

alint check reports:

Terminal window
--- big.txt --------------------------------------------------------------------
! warning under-10-bytes
file exceeds 10 byte(s) (actual: 42)
Summary (1 violation):
! 1 warning
0 passing * 1 failing

This repository is compliant:

also_tiny.txt
tiny.txt
also_tiny.txt
hi
tiny.txt
x

With this .alint.yml:

version: 1
rules:
- id: under-10-bytes
kind: file_max_size
paths: "**/*.txt"
max_bytes: 10
level: warning

alint check reports:

Terminal window
v All 1 rule(s) passed.