{"id":25869951,"url":"https://github.com/melevir/flake8-obey-import-goat","last_synced_at":"2025-03-02T05:29:18.592Z","repository":{"id":43058396,"uuid":"444789657","full_name":"Melevir/flake8-obey-import-goat","owner":"Melevir","description":"An extension for flake8 that forbids some imports statements in some modules.","archived":false,"fork":false,"pushed_at":"2023-05-17T13:33:24.000Z","size":23,"stargazers_count":17,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-11T23:06:33.385Z","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/Melevir.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}},"created_at":"2022-01-05T12:08:08.000Z","updated_at":"2024-11-19T05:23:35.000Z","dependencies_parsed_at":"2024-01-06T09:54:56.510Z","dependency_job_id":null,"html_url":"https://github.com/Melevir/flake8-obey-import-goat","commit_stats":{"total_commits":10,"total_committers":2,"mean_commits":5.0,"dds":0.09999999999999998,"last_synced_commit":"f33370ec4367b227463d6f4a0469f623eeeede2d"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Melevir%2Fflake8-obey-import-goat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Melevir%2Fflake8-obey-import-goat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Melevir%2Fflake8-obey-import-goat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Melevir%2Fflake8-obey-import-goat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Melevir","download_url":"https://codeload.github.com/Melevir/flake8-obey-import-goat/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241464996,"owners_count":19967237,"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","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":"2025-03-02T05:29:18.049Z","updated_at":"2025-03-02T05:29:18.575Z","avatar_url":"https://github.com/Melevir.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# flake8-obey-import-goat\n\nAn extension for flake8 that forbids some imports statements\nin some modules.\n\n**Important**: this project is developed using DDD, so some of the docs\ncan not exists. Stay tuned :)\n\n## Installation\n\n```terminal\npip install flake8-obey-import-goat\n```\n\n## Example\n\n```python\n# foo.py\nfrom datetime import datetime\nfrom typing import Optional\n\ndef foo():\n    pass\n\n\n# users/bar.py\nfrom foo import foo\n\n\n# users/domain.py\ndef foo():\n    pass\n\n\n# users/implementation.py\nfrom users.domain import foo\n\n\n# orders/implementation.py\nfrom users.domain import foo\n```\n\n```\n# setup.cfg\n[flake8]\nforbidden-imports =\n    *: datetime.datetime, stdlib modules should be imported as a module\n    *: typing.Optional, we use T | None instead of Optional[T]\n    users.*: foo.*, users module should not use foo module\n    *.implementation.*: *.domain.*, implementation layer should not use domain layer\n```\n\nUsage:\n\n```terminal\n$ flake8 test.py\nfoo.py:1:1: OIG001 datetime.datetime is forbidden, since stdlib modules should be imported as a module.\nfoo.py:2:1: OIG001 typing.Optional is forbidden, since we use T | None instead of Optional[T].\nusers/bar.py:1:1: OIG001 foo.foo import is forbidden is forbidden, since users module should not use foo module.\nusers/implementation.py:1:1: OIG001 *.domain.* import is forbidden is forbidden, since implementation layer should not use domain layer.\norders/implementation.py:1:1: OIG001 *.domain.* import is forbidden is forbidden, since implementation layer should not use domain layer.\n\n```\n\nTested on Python 3.8+ and flake8 4.0+.\n\n## Error codes\n\n| Error code |                     Description          |\n|:----------:|:----------------------------------------:|\n|   OIG001   | importable is forbidden, since reason |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelevir%2Fflake8-obey-import-goat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmelevir%2Fflake8-obey-import-goat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelevir%2Fflake8-obey-import-goat/lists"}