conventional-commits/conventionalcommits.org

Specification doesn't permit footers without a body

Susko3 opened this issue · 2 comments

  1. A longer commit body MAY be provided after the short description [...]
  2. [...]
  3. One or more footers MAY be provided one blank line after the body. [...]

Since the footers are after the body, if there is no body -- there can't be any footers.

The examples show a commit message with only a description and footers, but no body:

### Commit message with both `!` and BREAKING CHANGE footer
```
chore!: drop support for Node 6
BREAKING CHANGE: use JavaScript features not available in Node 6.
```

The syntax given in the summary already makes clear that body is optional, and footers can be added even if body is absent, as in the example that you referred:

<type>[optional scope]: <description>
[optional body]
[optional footer(s)]

However, it's not clear whether "summary and example" take precedence over "specification" or vice-versa. Not without reason, one could assert that the "specification" holds the utmost authority as the definitive source of truth, while any other text simply strives to convey or interpret such specification.

-One or more footers MAY be provided one blank line after the body
+One or more footers MAY be provided one blank line after the body (or one blank line after the description, if body is omitted).

My reading

  1. Subject is mandatory
  2. Body is optional
  3. Footer is optional and comes after body

Then I read this case (subject + footer)

  1. Footer comes after body
  2. But there is no body
  3. Subject comes before body
  4. Therefore footer comes after subject