Heading Period Check

This rule detects and warns against periods that appear at the end of headings. It's based on Google's developer documentation style guide, which recommends against ending headings with periods. The motivation behind this rule is that periods at the end of headings are unnecessary and can make the document structure look less clean. Headings are meant to be brief labels or titles rather than complete sentences.

Examples:

✗ Incorrect:

# Installation Guide.
## How to Configure Settings.
### Understanding the Basics.

✓ Correct:

# Installation Guide
## How to Configure Settings
### Understanding the Basics

The rule specifically looks for:

  • Any lowercase letter or number followed by a period at the end of a heading
  • Only triggers in heading contexts (using the scope: heading parameter)
  • Will suggest removing the period automatically through its action parameter

Note that this rule only catches periods that follow alphanumeric characters - it won't flag periods that might appear in abbreviations or other contexts within the heading.

Rule Source

This rule comes from: https://github.com/jump-dev/JuMP.jl

Rule Definition

extends: existence
message: "Don't put a period at the end of a heading."
link: 'https://developers.google.com/style/capitalization#capitalization-in-titles-and-headings'
nonword: true
level: warning
scope: heading
action:
  name: edit
  params:
    - remove
    - '.'
tokens:
  - '[a-z0-9][.]\s*$'