Skip to main content

Flake8 plugin to check class attributes order

Project description

made-with-python Coverage Status Code style: black Checked with flake8 Imports: isort License EO principles respected here

flake8-cls-attr-order

A flake8 plugin that checks class attributes for the proper alphabetical order.

Tools

Production

Development

Usage

# cls.py

class Foo:
    BAR = ()
    ABRA = {}
flake8 cls.py
cls.py:1:1: CL200 wrong "Foo" class constants order, should be "ABRA, BAR"

Installation

pip install flake8-cls-attr-order
✨ 🍰 

Source code

git clone git@github.com:vyahello/flake8-cls-attr-order.git
cd flake8-cls-attr-order
python3 -m venv venv 
. venv/bin/activate
pip install -e .

⬆ back to top

Warnings

  • CL100 - class name should start with upper case letter.
  • CL200 - wrong class constants order.

Development notes

Testing

Unit tests

Please run the following script to start plugin unit tests:

pytest 

Package tests

Please run the following script to start plugin package tests:

bats test-package.bats 

CI

To be able to run code analysis, please execute command below:

./analyse-source-code.sh

Meta

Author – Vladimir Yahello.

Distributed under the MIT license. See license for more information.

You can reach out me at:

Contributing

I would highly appreciate any contribution and support. If you are interested to add your ideas into project please follow next simple steps:

  1. Clone the repository
  2. Configure git for the first time after cloning with your name and email
  3. pip install -r requirements.txt to install all project dependencies
  4. pip install -r requirements-dev.txt to install all development project dependencies
  5. Create your feature branch (git checkout -b feature/fooBar)
  6. Commit your changes (git commit -am 'Add some fooBar')
  7. Push to the branch (git push origin feature/fooBar)
  8. Create a new Pull Request

What's next

All recent activities and ideas are described at project issues page. If you have ideas you want to change/implement please do not hesitate and create an issue.

⬆ back to top

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

flake8_cls_attr_order-0.1.0-py3-none-any.whl (5.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page