.. _missing-final-newline:

missing-final-newline / C0304
=============================

**Message emitted:**

``Final newline missing``

**Description:**

*Used when the last line in a file is missing a newline.*

**Problematic code:**

.. literalinclude:: /data/messages/m/missing-final-newline/bad.py
   :language: python

**Correct code:**

.. literalinclude:: /data/messages/m/missing-final-newline/good.py
   :language: python


**Additional details:**

The POSIX standard defines a line as:
    "A sequence of zero or more non- <newline> characters plus a terminating <newline> character."

**Related links:**

- `POSIX Standard <https://pubs.opengroup.org/onlinepubs/9699919799/>`_
- `POSIX Standard Chapter 3.206 Line <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206>`_


Created by the `format <https://github.com/PyCQA/pylint/blob/main/pylint/checkers/format.py>`__ checker.