{ "info": { "author": "Python Discord", "author_email": "staff@pythondiscord.com", "bugtrack_url": null, "classifiers": [ "Environment :: Console", "Framework :: Flake8", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3 :: Only", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Software Development :: Quality Assurance" ], "description": "# flake8-annotations\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/flake8-annotations)\n![PyPI](https://img.shields.io/pypi/v/flake8-annotations)\n[![Build Status](https://dev.azure.com/python-discord/Python%20Discord/_apis/build/status/python-discord.flake8-annotations?branchName=master)](https://dev.azure.com/python-discord/Python%20Discord/_build/latest?definitionId=16&branchName=master)\n[![Discord](https://discordapp.com/api/guilds/267624335836053506/embed.png)](https://discord.gg/2B963hn)\n\n\n`flake8-annotations` is a plugin for [Flake8](http://flake8.pycqa.org/en/latest/) that detects the absence of [PEP 3107-style](https://www.python.org/dev/peps/pep-3107/) function annotations and [PEP 484-style](https://www.python.org/dev/peps/pep-0484/#type-comments) type comments (see: [Caveats](#Caveats-for-PEP-484-style-Type-Comments)).\n\nWhat this won't do: Check variable annotations (see: [PEP 526](https://www.python.org/dev/peps/pep-0526/)), respect stub files, or replace [mypy's](http://mypy-lang.org/) compile-time type checking.\n\n## Installation\n\nInstall from PyPi with your favorite `pip` invocation:\n\n```bash\n$ pip install flake8-annotations\n```\n\nIt will then be run automatically as part of Flake8.\n\nYou can verify it's being picked up by invoking the following in your shell:\n\n```bash\n$ flake8 --version\n3.7.8 (flake8-annotations: 1.1.0, mccabe: 0.6.1, pycodestyle: 2.5.0, pyflakes: 2.1.1) CPython 3.7.4 on Darwin\n```\n\n## Table of Warnings\n### Function Annotations\n| ID | Description |\n|----------|-----------------------------------------------|\n| `TYP001` | Missing type annotation for function argument |\n| `TYP002` | Missing type annotation for `*args` |\n| `TYP003` | Missing type annotation for `**kwargs` |\n\n### Method Annotations\n| ID | Description |\n|----------|----------------------------------------------------|\n| `TYP101` | Missing type annotation for `self` in method |\n| `TYP102` | Missing type annotation for `cls` in classmethod |\n\n### Return Annotations\n| ID | Description |\n|----------|-------------------------------------------------------|\n| `TYP201` | Missing return type annotation for public function |\n| `TYP202` | Missing return type annotation for protected function |\n| `TYP203` | Missing return type annotation for secret function |\n| `TYP204` | Missing return type annotation for special method |\n| `TYP205` | Missing return type annotation for staticmethod |\n| `TYP206` | Missing return type annotation for classmethod |\n\n### Type Comments\n| ID | Description |\n|----------|-----------------------------------------------------------|\n| `TYP301` | PEP 484 disallows both type annotations and type comments |\n\n## Caveats for PEP 484-style Type Comments\n### Function type comments\nFunction type comments are assumed to contain both argument and return type hints\n\nYes:\n```py\n# type: (int, int) -> bool\n```\n\nNo:\n```py\n# type: (int, int)\n```\n\nPython cannot parse the latter and will raise `SyntaxError: unexpected EOF while parsing`\n\n### Mixing argument type comments and function type comments\nSupport is provided for mixing argument and function type comments, provided that the function type comment use an Ellipsis for the arguments.\n\n```py\ndef foo(\n arg1, # type: bool\n arg2, # type: bool\n): # type: (...) -> bool\n pass\n```\n\nEllipes are ignored by `flake8-annotations` parser.\n\n**Note:** If present, function type comments will override any argument type comments.\n\n### Partial type comments\nPartially type hinted functions are supported\n\nFor example:\n\n```py\ndef foo(arg1, arg2):\n # type: (bool) -> bool\n pass\n```\nWill show `arg2` as missing a type hint.\n\n```py\ndef foo(arg1, arg2):\n # type: (..., bool) -> bool\n pass\n```\nWill show `arg1` as missing a type hint.\n\n## Contributing\nPlease take some time to read through our [contributing guidelines](CONTRIBUTING.md) before helping us with this project.\n\n### Development Environment\nThis project uses [Pipenv](https://docs.pipenv.org/en/latest/) to manage dependencies. With your fork cloned to your local machine, you can create a developer environment using:\n\n```bash\n$ pipenv sync --dev\n```\n\nNote: flake8-annotations is included in the Pipfile as an editable dependency so it will be included when flake8 is invoked in your developer environment.\n\nA [pre-commit](https://pre-commit.com) installation script and configuration is also provided to create a pre-commit hook so linting errors aren't committed:\n\n```bash\n$ pipenv run precommit\n```\n\n### Testing\nA [pytest](https://docs.pytest.org/en/latest/) suite is provided for testing:\n\n```bash\n$ pipenv run test\n```\n\n### Coverage\nTest coverage is provided by [pytest-cov](https://github.com/pytest-dev/pytest-cov) via a pipenv script:\n\n```bash\n$ pipenv run coverage\n```\n\nWhen running via pipenv, details on missing coverage is provided in the report to allow the user to generate additional tests for full coverage.\n\ne.g.\n\n```\n----------- coverage: platform win32, python 3.7.4-final-0 -----------\nName Stmts Miss Branch BrPart Cover Missing\n-------------------------------------------------------------------------------\nflake8_annotations\\__init__.py 108 0 38 0 99% 164\nflake8_annotations\\checker.py 57 0 30 0 100%\nflake8_annotations\\enums.py 15 0 0 0 100%\nflake8_annotations\\error_codes.py 85 0 0 0 100%\n-------------------------------------------------------------------------------\nTOTAL 265 0 68 0 99%\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/python-discord/flake8-annotations", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "flake8-annotations", "package_url": "https://pypi.org/project/flake8-annotations/", "platform": "", "project_url": "https://pypi.org/project/flake8-annotations/", "project_urls": { "Discord server": "https://discord.gg/python", "Homepage": "https://github.com/python-discord/flake8-annotations", "Issue tracker": "https://github.com/python-discord/flake8-annotations/issues" }, "release_url": "https://pypi.org/project/flake8-annotations/1.1.0/", "requires_dist": [ "flake8 (~=3.7.8)", "typed-ast (~=1.4)", "flake8-bugbear (~=19.8) ; extra == 'dev'", "flake8-docstrings (~=1.4) ; extra == 'dev'", "flake8-formatter-junit-xml (~=0.0) ; extra == 'dev'", "flake8-import-order (~=0.18) ; extra == 'dev'", "flake8-string-format (~=0.2) ; extra == 'dev'", "flake8-tidy-imports (~=2.0) ; extra == 'dev'", "flake8-todo (~=0.7) ; extra == 'dev'", "pre-commit (~=1.18) ; extra == 'dev'", "pytest (~=5.1) ; extra == 'dev'", "pytest-check (~=0.3) ; extra == 'dev'", "pytest-cov (~=2.7) ; extra == 'dev'" ], "requires_python": ">=3.6", "summary": "Flake8 Type Annotation Checks", "version": "1.1.0" }, "last_serial": 5886224, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "b0f23dd0254caaad19e23fc05744b4ff", "sha256": "1309f2bc9853a2d77d578b089d331b0b832b40c97932641e136e1b49d3650c82" }, "downloads": -1, "filename": "flake8_annotations-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "b0f23dd0254caaad19e23fc05744b4ff", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10466, "upload_time": "2019-09-09T12:54:33", "url": "https://files.pythonhosted.org/packages/cd/a4/af2d10e21c41bd84cb195d383cd2242a0ac73754fa2bc3e3ca20c0593723/flake8_annotations-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "187034badb00ae28427e436c829ab241", "sha256": "3ecdd27054c3eed6484139025698465e3c9f4e68dbd5043d0204fcb2550ee27b" }, "downloads": -1, "filename": "flake8_annotations-1.0.0.tar.gz", "has_sig": false, "md5_digest": "187034badb00ae28427e436c829ab241", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8584, "upload_time": "2019-09-09T12:54:35", "url": "https://files.pythonhosted.org/packages/ea/2b/7f7bbb3ee2d7052b7db64f81aa26b5044ca387edda2b91010b9464dc1bd1/flake8_annotations-1.0.0.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "5bd6c98999b68a1acfa8d9d811c2e62b", "sha256": "6ac7ca1e706307686b60af8043ff1db31dc2cfc1233c8210d67a3d9b8f364736" }, "downloads": -1, "filename": "flake8_annotations-1.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "5bd6c98999b68a1acfa8d9d811c2e62b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 12237, "upload_time": "2019-09-25T16:25:13", "url": "https://files.pythonhosted.org/packages/ed/33/3b59d4616d09b09f2d23da2d6f6dbe707bfb89a5112be9b042b2092bed2f/flake8_annotations-1.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "12612702c2f205e3bc41bc60de754b6a", "sha256": "b51131007000d67217608fa028a35ff80aa400b474e5972f1f99c2cf9d26bd2e" }, "downloads": -1, "filename": "flake8-annotations-1.1.0.tar.gz", "has_sig": false, "md5_digest": "12612702c2f205e3bc41bc60de754b6a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 11707, "upload_time": "2019-09-25T16:25:15", "url": "https://files.pythonhosted.org/packages/9b/78/5c07662abd8eeb28cb4fada694a5b1581253d53a85b6ad4bf2074b86809f/flake8-annotations-1.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5bd6c98999b68a1acfa8d9d811c2e62b", "sha256": "6ac7ca1e706307686b60af8043ff1db31dc2cfc1233c8210d67a3d9b8f364736" }, "downloads": -1, "filename": "flake8_annotations-1.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "5bd6c98999b68a1acfa8d9d811c2e62b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 12237, "upload_time": "2019-09-25T16:25:13", "url": "https://files.pythonhosted.org/packages/ed/33/3b59d4616d09b09f2d23da2d6f6dbe707bfb89a5112be9b042b2092bed2f/flake8_annotations-1.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "12612702c2f205e3bc41bc60de754b6a", "sha256": "b51131007000d67217608fa028a35ff80aa400b474e5972f1f99c2cf9d26bd2e" }, "downloads": -1, "filename": "flake8-annotations-1.1.0.tar.gz", "has_sig": false, "md5_digest": "12612702c2f205e3bc41bc60de754b6a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 11707, "upload_time": "2019-09-25T16:25:15", "url": "https://files.pythonhosted.org/packages/9b/78/5c07662abd8eeb28cb4fada694a5b1581253d53a85b6ad4bf2074b86809f/flake8-annotations-1.1.0.tar.gz" } ] }