{"id":13735123,"url":"https://github.com/tyleryep/flake8-future-annotations","last_synced_at":"2025-09-10T16:33:05.135Z","repository":{"id":40356509,"uuid":"384816648","full_name":"TylerYep/flake8-future-annotations","owner":"TylerYep","description":"Verifies python 3.7+ files use `from __future__ import annotations`","archived":false,"fork":false,"pushed_at":"2025-09-02T16:28:54.000Z","size":200,"stargazers_count":16,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-02T18:24:53.425Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TylerYep.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-07-10T23:19:00.000Z","updated_at":"2025-09-02T16:28:57.000Z","dependencies_parsed_at":"2023-12-28T21:38:10.510Z","dependency_job_id":"e9e2649e-647a-4e51-b078-f7d4e69f4d51","html_url":"https://github.com/TylerYep/flake8-future-annotations","commit_stats":{"total_commits":71,"total_committers":5,"mean_commits":14.2,"dds":"0.45070422535211263","last_synced_commit":"f409d0ad2e8ab94e63ccc6e18288399acb0dde04"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/TylerYep/flake8-future-annotations","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TylerYep%2Fflake8-future-annotations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TylerYep%2Fflake8-future-annotations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TylerYep%2Fflake8-future-annotations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TylerYep%2Fflake8-future-annotations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TylerYep","download_url":"https://codeload.github.com/TylerYep/flake8-future-annotations/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TylerYep%2Fflake8-future-annotations/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274487231,"owners_count":25294480,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-10T02:00:12.551Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T03:01:03.235Z","updated_at":"2025-09-10T16:33:05.030Z","avatar_url":"https://github.com/TylerYep.png","language":"Python","funding_links":[],"categories":["Type annotations"],"sub_categories":[],"readme":"# flake8-future-annotations\n\n[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/release/python-380/)\n[![PyPI version](https://badge.fury.io/py/flake8-future-annotations.svg)](https://badge.fury.io/py/flake8-future-annotations)\n[![GitHub license](https://img.shields.io/github/license/TylerYep/flake8-future-annotations)](https://github.com/TylerYep/flake8-future-annotations/blob/main/LICENSE)\n[![Downloads](https://pepy.tech/badge/flake8-future-annotations)](https://pepy.tech/project/flake8-future-annotations)\n\nVerifies python 3.8+ files use `from __future__ import annotations` if a type is used in the module that can be rewritten using [PEP 563](https://www.python.org/dev/peps/pep-0563/).\n\nPairs well with [pyupgrade](https://github.com/asottile/pyupgrade) with the `--py37-plus` flag or higher, since pyupgrade only replaces type annotations with the PEP 563 rules if `from __future__ import annotations` is present.\n\n[The flake8-future-annotations plugin, along with autofixes, is now available in Ruff!](https://github.com/astral-sh/ruff/issues/3072)\n\n## flake8 codes\n\n| Code  | Description                                                               |\n| ----- | ------------------------------------------------------------------------- |\n| FA100 | Missing import if a type used in the module can be rewritten using PEP563 |\n| FA101 | Missing import when no rewrite using PEP563 is available (see config)     |\n| FA102 | Missing import when code uses simplified types (list, dict, set, etc)     |\n\n## Example\n\n```python\nimport typing as t\nfrom typing import List\n\ndef function(a_dict: t.Dict[str, t.Optional[int]]) -\u003e None:\n    a_list: List[str] = []\n    a_list.append(\"hello\")\n```\n\nAs a result, this plugin will emit:\n\n```\nhello.py:1:1: FA100 Missing from __future__ import annotations but imports: List, t.Dict, t.Optional\n```\n\nAfter adding the future annotations import, running `pyupgrade` allows the code to be automatically rewritten as:\n\n```python\nfrom __future__ import annotations\n\ndef function(a_dict: dict[str, int | None]) -\u003e None:\n    a_list: list[str] = []\n    a_list.append(\"hello\")\n```\n\n## Configuration\n\nIf the `--force-future-annotations` option is set, missing `from __future__ import annotations` will be reported regardless of a rewrite available according to PEP 563; in this case, code FA101 is used instead of FA100.\n\nIf the `--check-future-annotations` option is set, missing `from __future__ import annotations` will be reported because the following code will error on Python versions older than 3.10 (this check should not be enabled on Python 3.10+):\n\n```python\ndef function(a_dict: dict[str, int | None]) -\u003e None:\n    a_list: list[str] = []\n    a_list.append(\"hello\")\n```\n\n```\nhello.py:1:1: FA102 Missing from __future__ import annotations but uses simplified type annotations: dict, list, union\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftyleryep%2Fflake8-future-annotations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftyleryep%2Fflake8-future-annotations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftyleryep%2Fflake8-future-annotations/lists"}