flake8-final
Background
Implementation inheritance can lead to brittle and hard-to-maintain code. By enforcing the use of the @final decorator, this plugin aims to encourage composition over inheritance, promoting better software design principles.
Installation
To install flake8-final, you can use pip:
pip install flake8-final
Usage
After installing the plugin, flake8 will automatically use it when you run the following command:
flake8 your_project_directory
The plugin will check each class definition to ensure it has a @final decorator. If a class is missing the @final decorator, an error will be reported.
Example
Given the following Python code:
class MyClass:
pass
Running flake8 will produce the following error:
your_file.py:1:1: FIN100 class must be final
Adding the @final decorator will resolve the error:
from typing import final
@final
class MyClass:
pass
License
Credits
This project was generated with wemake-python-package. Current template version is: 9899cb192f754a566da703614227e6d63227b933. See what is updated since then.
Release files for flake8-final 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| flake8_final-0.0.4.tar.gz | 3.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| flake8_final-0.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.8 kB
Release files / flake8_final-0.0.4.tar.gz
| Download URL | flake8_final-0.0.4.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c1b3df37e7e7ab017ee0fbcb7e2500fc36c7eb80c02d89652e3ed712ee0778a7
|
|
BLAKE2b-256 checksum How to use checksums |
f097f9a8ddedcd85e34e0a4556080ca3cb99a1a5a2279904817dfa857224d4ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.13.1 Linux/6.17.0-1022-azure
|
Release files / flake8_final-0.0.4-py3-none-any.whl
| Download URL | flake8_final-0.0.4-py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
370d50e944ad7b546774b982c2a5073dae810ba6741e7514f4eb526cc2df4fa9
|
|
BLAKE2b-256 checksum How to use checksums |
afa0a518131680bbc21885d5005b27929ac9337918343621c48a09c3c71f8077
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.13.1 Linux/6.17.0-1022-azure
|