Flake8 lint for newline after class definitions.
Project description
Flake8 Extension to lint for a newline after a Class definition
===========================================
.. image:: https://travis-ci.org/AlexvEck/flake8-class-newline.svg?branch=master
:target: https://travis-ci.org/AlexvEck/flake8-class-newline
:alt: Build Status
Usage
-----
If you are using flake8, you can install this package through pip.
.. code:: shell
pip install flake8-class-newline
This plugin is then automatically triggered when you run;
.. code:: shell
flake8
It produces only 1 error type; "CNL100: Class definition does not have a new line."
NOTE; Documentation blocks (or docblocks) should be on the newline, they are therefore ignored by this plugin. See https://www.python.org/dev/peps/pep-0008/#documentation-strings
Example
-----
PEP8 is unclear on whether we should allow for a newline after a class definition.
Basically;
.. code:: python
class AClassWithoutANewLine(object):
an_arg = 'a_value'
or
.. code:: python
class AClassWithANewLine(object):
an_arg = 'a_value'
The former seems to be widely accepted by auto-formatters. This plugin was made to enforce the latter.
Special Notice
-----
This package was inspired by flake8-quotes created by @zheller.
Thanks for the inspiration!
===========================================
.. image:: https://travis-ci.org/AlexvEck/flake8-class-newline.svg?branch=master
:target: https://travis-ci.org/AlexvEck/flake8-class-newline
:alt: Build Status
Usage
-----
If you are using flake8, you can install this package through pip.
.. code:: shell
pip install flake8-class-newline
This plugin is then automatically triggered when you run;
.. code:: shell
flake8
It produces only 1 error type; "CNL100: Class definition does not have a new line."
NOTE; Documentation blocks (or docblocks) should be on the newline, they are therefore ignored by this plugin. See https://www.python.org/dev/peps/pep-0008/#documentation-strings
Example
-----
PEP8 is unclear on whether we should allow for a newline after a class definition.
Basically;
.. code:: python
class AClassWithoutANewLine(object):
an_arg = 'a_value'
or
.. code:: python
class AClassWithANewLine(object):
an_arg = 'a_value'
The former seems to be widely accepted by auto-formatters. This plugin was made to enforce the latter.
Special Notice
-----
This package was inspired by flake8-quotes created by @zheller.
Thanks for the inspiration!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for flake8-class-newline-1.3.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f5a6918fcfb33eeddc93c7c033f891f087fe7d16b8f6b07cd01f8820e376aad |
|
MD5 | b499ee76cc85fbc0194ee5f5bc324e8a |
|
BLAKE2b-256 | 9797e00a7ed6dfcc105d81daf0bf3687d757efc5a63aa361f4112833531df237 |