flake8-one-class


Nameflake8-one-class JSON
Version 0.0.1 PyPI version JSON
download
home_pagehttps://github.com/blablatdinov/flake8-one-class
Summaryflake8 plugin for check and inheritance of implementations
upload_time2024-11-10 00:52:06
maintainerNone
docs_urlNone
authorAlmaz Ilaletdinov
requires_python<4.0,>=3.9
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <!---
The MIT License (MIT)

Copyright (c) 2024 Almaz Ilaletdinov <a.ilaletdniov@yandex.ru>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
OR OTHER DEALINGS IN THE SOFTWARE.
--->

# flake8-one-class

[![test](https://github.com/blablatdinov/flake8-one-class/actions/workflows/test.yml/badge.svg)](https://github.com/blablatdinov/flake8-one-class/actions/workflows/test.yml)
[![codecov](https://codecov.io/gh/blablatdinov/flake8-one-class/branch/master/graph/badge.svg)](https://codecov.io/gh/blablatdinov/flake8-one-class)
[![Python Version](https://img.shields.io/pypi/pyversions/flake8-one-class.svg)](https://pypi.org/project/flake8-one-class/)
[![wemake-python-styleguide](https://img.shields.io/badge/style-wemake-000000.svg)](https://github.com/wemake-services/wemake-python-styleguide)

## Background

In Python modules, having multiple classes in a single file can often indicate overly complex code or an unclear separation of concerns. The flake8-one-class plugin enforces a single public class per module to encourage modular and maintainable code design. Private (internal) classes are allowed but are intended for module-level encapsulation only.

## Installation

Install flake8-one-class using pip:

```
pip install flake8-one-class
```

## Usage

After installation, flake8-one-class will automatically run with flake8:

```
flake8 your_project_directory
```

This plugin checks each module for multiple public class definitions. If more than one public class is detected, an error is raised.

## Example

Given the following Python code:

```python
class Animal:
    pass

class Plant:
    pass
```

Running flake8 will produce the following error:

```
your_file.py:1:1: FOC100 found module with more than one public class
```

Using only one public class in the module will resolve the error:

```python
class Animal:
    pass

class _Helper:  # private class is allowed
    pass
```


## License

[MIT](https://github.com/blablatdinov/flake8-one-class/blob/master/LICENSE)


## Credits

This project was generated with [`wemake-python-package`](https://github.com/wemake-services/wemake-python-package). Current template version is: [9899cb192f754a566da703614227e6d63227b933](https://github.com/wemake-services/wemake-python-package/tree/9899cb192f754a566da703614227e6d63227b933). See what is [updated](https://github.com/wemake-services/wemake-python-package/compare/9899cb192f754a566da703614227e6d63227b933...master) since then.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/blablatdinov/flake8-one-class",
    "name": "flake8-one-class",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": "Almaz Ilaletdinov",
    "author_email": "a.ilaletdinov@yandex.ru",
    "download_url": "https://files.pythonhosted.org/packages/a7/42/36e0a53368178c849715bef9f07754d46133969ae71ac2464d9a1bcb140b/flake8_one_class-0.0.1.tar.gz",
    "platform": null,
    "description": "<!---\nThe MIT License (MIT)\n\nCopyright (c) 2024 Almaz Ilaletdinov <a.ilaletdniov@yandex.ru>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\nDAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\nOTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE\nOR OTHER DEALINGS IN THE SOFTWARE.\n--->\n\n# flake8-one-class\n\n[![test](https://github.com/blablatdinov/flake8-one-class/actions/workflows/test.yml/badge.svg)](https://github.com/blablatdinov/flake8-one-class/actions/workflows/test.yml)\n[![codecov](https://codecov.io/gh/blablatdinov/flake8-one-class/branch/master/graph/badge.svg)](https://codecov.io/gh/blablatdinov/flake8-one-class)\n[![Python Version](https://img.shields.io/pypi/pyversions/flake8-one-class.svg)](https://pypi.org/project/flake8-one-class/)\n[![wemake-python-styleguide](https://img.shields.io/badge/style-wemake-000000.svg)](https://github.com/wemake-services/wemake-python-styleguide)\n\n## Background\n\nIn Python modules, having multiple classes in a single file can often indicate overly complex code or an unclear separation of concerns. The flake8-one-class plugin enforces a single public class per module to encourage modular and maintainable code design. Private (internal) classes are allowed but are intended for module-level encapsulation only.\n\n## Installation\n\nInstall flake8-one-class using pip:\n\n```\npip install flake8-one-class\n```\n\n## Usage\n\nAfter installation, flake8-one-class will automatically run with flake8:\n\n```\nflake8 your_project_directory\n```\n\nThis plugin checks each module for multiple public class definitions. If more than one public class is detected, an error is raised.\n\n## Example\n\nGiven the following Python code:\n\n```python\nclass Animal:\n    pass\n\nclass Plant:\n    pass\n```\n\nRunning flake8 will produce the following error:\n\n```\nyour_file.py:1:1: FOC100 found module with more than one public class\n```\n\nUsing only one public class in the module will resolve the error:\n\n```python\nclass Animal:\n    pass\n\nclass _Helper:  # private class is allowed\n    pass\n```\n\n\n## License\n\n[MIT](https://github.com/blablatdinov/flake8-one-class/blob/master/LICENSE)\n\n\n## Credits\n\nThis project was generated with [`wemake-python-package`](https://github.com/wemake-services/wemake-python-package). Current template version is: [9899cb192f754a566da703614227e6d63227b933](https://github.com/wemake-services/wemake-python-package/tree/9899cb192f754a566da703614227e6d63227b933). See what is [updated](https://github.com/wemake-services/wemake-python-package/compare/9899cb192f754a566da703614227e6d63227b933...master) since then.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "flake8 plugin for check and inheritance of implementations",
    "version": "0.0.1",
    "project_urls": {
        "Homepage": "https://github.com/blablatdinov/flake8-one-class",
        "Repository": "https://github.com/blablatdinov/flake8-one-class"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b7bce491dfcfbffb49ee7f6e66f9be6b36cdec77102fed4184c9d83b522811e6",
                "md5": "afce5bc5b7c39d04e50de5e9a4cfcd3b",
                "sha256": "3c47e5ba03516891af5b77c5e231772bdf4c37ab2ce14919caacb35451e0b862"
            },
            "downloads": -1,
            "filename": "flake8_one_class-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "afce5bc5b7c39d04e50de5e9a4cfcd3b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 7723,
            "upload_time": "2024-11-10T00:52:05",
            "upload_time_iso_8601": "2024-11-10T00:52:05.160241Z",
            "url": "https://files.pythonhosted.org/packages/b7/bc/e491dfcfbffb49ee7f6e66f9be6b36cdec77102fed4184c9d83b522811e6/flake8_one_class-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a74236e0a53368178c849715bef9f07754d46133969ae71ac2464d9a1bcb140b",
                "md5": "994327bb449ca0c728bcf0febfcc5036",
                "sha256": "15673b02671b4889144d889e8da14dac5ac7af1f33f5633ab411739a58aefe4f"
            },
            "downloads": -1,
            "filename": "flake8_one_class-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "994327bb449ca0c728bcf0febfcc5036",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 3380,
            "upload_time": "2024-11-10T00:52:06",
            "upload_time_iso_8601": "2024-11-10T00:52:06.742764Z",
            "url": "https://files.pythonhosted.org/packages/a7/42/36e0a53368178c849715bef9f07754d46133969ae71ac2464d9a1bcb140b/flake8_one_class-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-10 00:52:06",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "blablatdinov",
    "github_project": "flake8-one-class",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "flake8-one-class"
}
        
Elapsed time: 0.35206s