Skip to content

no_empty_files

Flag zero-byte files. Fixable via file_remove.


This rule takes no kind-specific options.

Plus the common paths, level, id, and when fields. This table is generated from the JSON Schema; option types and defaults are authoritative.

Zero-byte placeholder files left in the tree

Section titled “Zero-byte placeholder files left in the tree”

The rule fires on this repository:

README.md
placeholder.rs
stray.log
README.md
# hi

With this .alint.yml:

version: 1
rules:
- id: no-empty
kind: no_empty_files
paths: "**"
level: warning

alint check reports:

Terminal window
--- placeholder.rs -------------------------------------------------------------
! warning no-empty
file is empty
--- stray.log ------------------------------------------------------------------
! warning no-empty
file is empty
Summary (2 violations):
! 2 warnings
0 passing * 1 failing

Every file carries at least one byte of content

Section titled “Every file carries at least one byte of content”

This repository is compliant:

README.md
src/
src/a.rs
README.md
# hi
src/a.rs
fn a() {}

With this .alint.yml:

version: 1
rules:
- id: no-empty
kind: no_empty_files
paths: "**"
level: warning

alint check reports:

Terminal window
v All 1 rule(s) passed.