a-kenji/sizelint
Lint your file tree based on file sizes
{ "createdAt": "2025-07-16T21:39:17Z", "defaultBranch": "main", "description": " Lint your file tree based on file sizes ", "fullName": "a-kenji/sizelint", "homepage": "", "language": "Rust", "name": "sizelint", "pushedAt": "2026-03-05T10:06:52Z", "stargazersCount": 16, "topics": [ "ci-cd", "cli", "code-quality", "developer-tools", "file-size", "formatter", "linter", "pre-commit" ], "updatedAt": "2026-03-05T10:06:56Z", "url": "https://github.com/a-kenji/sizelint"}$ sizelint - lint your working tree based on file sizes
Section titled “$ sizelint - lint your working tree based on file sizes”sizelint is a fast, configurable file size linter that helps prevent large files from entering your Git repository.
It can be used as a standalone tool, pre-commit hook, or as part of your CI/CD pipeline.
Overview
Section titled “Overview”- [
$ sizelint- lint your working tree based on file sizes]!(#sizelint-lint-your-working-tree-based-on-file-sizes)- [
$ sizelint- usage]!(#-sizelint---usage)- [
$ sizelint check]!(#-sizelint-check) - [
$ sizelint rules]!(#-sizelint-rules) - [
$ sizelint init]!(#-sizelint-init)
- [
- [Configuration]!(#configuration)
- [Documentation]!(#documentation)
- [Development]!(#development)
- [License]!(#license)
- [
$ sizelint - usage
Section titled “$ sizelint - usage”Lint your working tree based on file size
Usage: sizelint [OPTIONS] <COMMAND>
Commands: check Check files for size violations init Initialize sizelint configuration rules Rule management completions Generate shell completions help Print this message or the help of the given subcommand(s)
Options: -c, --config <FILE> Configuration file path --debug Enable debug output (or set SIZELINT_LOG for fine-grained control) -h, --help Print help -V, --version Print version$ sizelint check
Section titled “$ sizelint check”Check files for size violations
Usage: sizelint check [OPTIONS] [PATHS]...
Arguments: [PATHS]... Paths to check
Options: -c, --config <FILE> Configuration file path
-f, --format <FORMAT> Output format
Possible values: - human: Human-readable output - json: JSON output
[default: human]
--staged Check only staged files (git diff --staged)
--working-tree Check working tree files
--git <RANGE> Check files changed in a git revision range (e.g. "main", "main..HEAD", "main...feature")
--no-history Skip git history scanning for deleted blobs (only check files at HEAD)
-q, --quiet Quiet mode (only show violations)
--fail-on-warn Treat warnings as errors
-h, --help Print help (see a summary with '-h')$ sizelint rules
Section titled “$ sizelint rules”Rule management
Usage: sizelint rules <COMMAND>
Commands: list List available rules describe Show rule documentation help Print this message or the help of the given subcommand(s)
Options: -h, --help Print help$ sizelint init
Section titled “$ sizelint init”Initialize sizelint configuration
Usage: sizelint init [OPTIONS]
Options: -f, --force Force overwrite existing configuration --stdout Print the default configuration to stdout --edit Open configuration file in editor after creation -h, --help Print helpQuick Start
Section titled “Quick Start”Installation
Section titled “Installation”cargo install sizelint --lockedBasic Usage
Section titled “Basic Usage”# Initialize configurationsizelint init
# Check all filessizelint check
# Check specific filessizelint check src/main.rs README.mdGit Integration
Section titled “Git Integration”# Check files changed since diverging from mainsizelint check --git main
# Scan the entire history of a branch for oversized blobssizelint check --git "$(git hash-object -t tree /dev/null)..master"Configuration
Section titled “Configuration”sizelint uses TOML configuration files.
Run sizelint init to create a default configuration:
max_file_size = "2MB"warn_file_size = "1MB"excludes = []check_staged = falsecheck_working_tree = falserespect_gitignore = truefail_on_warn = false
[rules.default]enabled = truedescription = "Default file size check"suggestion = "Add the file to 'excludes' or adjust 'max_file_size' in sizelint.toml"
[rules.medium_files]enabled = falsedescription = "Base rule that fits many normal repos"priority = 50max_size = "5MB"warn_size = "2MB"includes = []excludes = []
[rules.no_images]enabled = falsedescription = "Warn about image files that might be better handled with LFS"priority = 80includes = ["*.png", "*.jpg", "*.jpeg", "*.gif", "*.bmp"]excludes = []warn_on_match = truesuggestion = "Consider using Git LFS: git lfs track '*.png'"Documentation
Section titled “Documentation”- [Manual Page]!(docs/sizelint.1.scd) - Reference in scdoc format
Development
Section titled “Development”Development Shell
Section titled “Development Shell”nix developBuilding
Section titled “Building”cargo build --releaseTesting
Section titled “Testing”cargo testcargo clippyLicense
Section titled “License”MIT License - see [LICENSE]!(LICENSE) file for details.