Skip to content

Latest commit

 

History

History
76 lines (55 loc) · 1.07 KB

File metadata and controls

76 lines (55 loc) · 1.07 KB
id MDS009
name single-trailing-newline
status ready
description File must end with exactly one newline character.

MDS009: single-trailing-newline

File must end with exactly one newline character.

Config

Enable:

rules:
  single-trailing-newline: true

Disable:

rules:
  single-trailing-newline: false

Examples

Good

# Title

Content here.

The file ends with exactly one \n after the last line.

Bad

# Title

Content here.

The file has no trailing newline after the last line. The <?include?> output looks identical because the wrap always adds a newline, but the actual fixture file (bad/default.md) ends without one — that missing byte is what the rule detects.

Meta-Information

  • ID: MDS009
  • Name: single-trailing-newline
  • Status: ready
  • Default: enabled
  • Fixable: yes
  • Implementation: source
  • Category: whitespace