WSC006: Too many newlines at the end of file

This rule enforces one \n at end of file.

Example

Input file: examples/WSC006_too_many_new_lines_at_eof.py

class LabelPrinter:
    def __get_pdf_path(self) -> str:
        pdf_name = self.__pdf_name_template.format(
            data=self.__data,
            title_hash=hashlib.sha1(self.__title.encode()).hexdigest())
        return os.path.join(self.__print_cache_dir, pdf_name)

Command:

$ wscheck 'examples/WSC006_too_many_new_lines_at_eof.py'
In examples/WSC006_too_many_new_lines_at_eof.py line 6:
        return os.path.join(self.__print_cache_dir, pdf_name)
                                                             ^-- WSC006: Too many newline at end of file (+1)