no_empty_files
Flag zero-byte files. Fixable via file_remove.
Options
Section titled “Options”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.
Example
Section titled “Example”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.mdplaceholder.rsstray.log# hiWith this .alint.yml:
version: 1rules: - id: no-empty kind: no_empty_files paths: "**" level: warningalint check reports:
--- placeholder.rs ------------------------------------------------------------- ! warning no-empty file is empty
--- stray.log ------------------------------------------------------------------ ! warning no-empty file is empty
Summary (2 violations): ! 2 warnings 0 passing * 1 failingEvery file carries at least one byte of content
Section titled “Every file carries at least one byte of content”This repository is compliant:
README.mdsrc/src/a.rs# hifn a() {}With this .alint.yml:
version: 1rules: - id: no-empty kind: no_empty_files paths: "**" level: warningalint check reports:
v All 1 rule(s) passed.