{"id":15828231,"url":"https://github.com/jdkandersson/flake8-error-link","last_synced_at":"2026-01-21T12:01:36.525Z","repository":{"id":64943859,"uuid":"579569343","full_name":"jdkandersson/flake8-error-link","owner":"jdkandersson","description":"A linter that ensures all raised Exceptions include an error with a link to more information","archived":false,"fork":false,"pushed_at":"2023-10-01T09:46:18.000Z","size":58,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-17T16:30:13.381Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jdkandersson.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2022-12-18T05:46:35.000Z","updated_at":"2022-12-20T12:09:53.000Z","dependencies_parsed_at":"2024-10-26T15:14:09.307Z","dependency_job_id":"82a26464-aaa4-4224-a378-3628febf486a","html_url":"https://github.com/jdkandersson/flake8-error-link","commit_stats":{"total_commits":14,"total_committers":1,"mean_commits":14.0,"dds":0.0,"last_synced_commit":"fcc7a58ae5c91997c505f7071f5c8f3255cbb119"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/jdkandersson/flake8-error-link","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdkandersson%2Fflake8-error-link","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdkandersson%2Fflake8-error-link/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdkandersson%2Fflake8-error-link/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdkandersson%2Fflake8-error-link/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdkandersson","download_url":"https://codeload.github.com/jdkandersson/flake8-error-link/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdkandersson%2Fflake8-error-link/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28632781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T04:47:28.174Z","status":"ssl_error","status_checked_at":"2026-01-21T04:47:22.943Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-10-05T10:22:25.664Z","updated_at":"2026-01-21T12:01:36.509Z","avatar_url":"https://github.com/jdkandersson.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# flake8-error-link\n\nHave you ever encountered an error when using a package and then gone to Google\nto find out how to solve the error? Wouldn't your users prefer to go directly\nto your documentation that tells them exactly what went wrong and how to\nresolve that error? `flake8-error-link` checks the way exceptions are raised in\nyour code base to ensure that a link with more information is provided.\n\n## Getting Started\n\n```shell\npython -m venv venv\nsource ./venv/bin/activate\npip install flake8 flake8-error-link\nflake8 source.py\n```\n\nOn the following code:\n\n```Python\n# source.py\nraise Exception\n```\n\nThis will produce warnings such as:\n\n```shell\nsource.py:1:0: ELI001 builtin exceptions should be raised with a link to more information: https://github.com/jdkandersson/flake8-error-link#fix-eli001\n```\n\nThis can be resolved by changing the code to:\n\n```Python\n# source.py\nraise Exception(\"more information: https://github.com/jdkandersson/flake8-error-link#fix-eli001\")\n```\n\n## Configuration\n\nThe plugin adds the following configurations to `flake8`:\n\n* `--error-link-regex`: The regular expression to use to verify the way\n  exceptions are reased, defaults to\n  `more information: (mailto\\:|(news|(ht|f)tp(s?))\\:\\/\\/){1}\\S+`\n\n\n## Rules\n\nA few rules have been defined to allow for selective suppression:\n\n* `ELI001`: checks that any builtin exceptions that are raised with constant\n   arguments include a link to more information.\n* `ELI002`: checks that any custom exceptions that are raised with constant\n   arguments include a link to more information.\n* `ELI003`: checks that any exceptions that are raised with variable arguments\n  include a constant argument with a link to more information.\n* `ELI004`: checks that any exceptions that are re-raised include a constant\n  argument with a link to more information.\n\n### Fix ELI001\n\nThis linting rule is trigger by raising an inbuilt exception without providing\na constant that includes a link to more information as one of the arguments to\nthe constructor. For example:\n\n```Python\nraise Exception\n\nraise ValueError\n\nraise Exception()\n\nraise Exception(\"oh no! :(\")\n```\n\nThese examples can be fixed by using something like:\n\n```Python\nraise Exception(\n    \"more information: https://github.com/jdkandersson/flake8-error-link#fix-eli001\"\n)\n\nraise ValueError(\n    \"more information: https://github.com/jdkandersson/flake8-error-link#fix-eli001\"\n)\n\nraise Exception(\n    \"more information: https://github.com/jdkandersson/flake8-error-link#fix-eli001\"\n)\n\nraise Exception(\n    \"oh no! :(\",\n    \"more information: https://github.com/jdkandersson/flake8-error-link#fix-eli001\",\n)\n```\n\n### Fix ELI002\n\nThis linting rule is trigger by raising a custom exception without providing\na constant that include a link to more information as one of the arguments to\nthe constructor. For example:\n\n```Python\nclass CustomError(Exception):\n    pass\n\nraise CustomError\n\nraise CustomError()\n\nraise CustomError(\"bummer...\")\n```\n\nThese examples can be fixed by using something like:\n\n```Python\nclass CustomError(Exception):\n    pass\n\nraise CustomError(\n    \"more information: https://github.com/jdkandersson/flake8-error-link#fix-eli002\"\n)\n\nraise CustomError(\n    \"more information: https://github.com/jdkandersson/flake8-error-link#fix-eli002\"\n)\n\nraise CustomError(\n    \"bummer...\",\n    \"more information: https://github.com/jdkandersson/flake8-error-link#fix-eli002\",\n)\n```\n\n### Fix ELI003\n\nThis linting rule is trigger by raising an exception and passing at least one\nargument without providing a constant that include a link to more information\nas one of the arguments to the constructor. For example:\n\n```Python\nmessage = \"gotcha\"\n\ndef get_message():\n    return message\n\nraise Exception(get_message())\n\nraise Exception(f\"{message} quite badly\")\n```\n\nThese examples can be fixed by using something like:\n\n```Python\nmessage = \"gotcha\"\n\ndef get_message():\n    return message\n\nraise Exception(\n    get_message(),\n    \"more information: https://github.com/jdkandersson/flake8-error-link#fix-eli003\",\n)\n\nraise Exception(\n    f\"{message} quite badly, more information: https://github.com/jdkandersson/flake8-error-link#fix-eli003\"\n)\n```\n\n### Fix ELI004\n\nThis linting rule is trigger by re-raising an exception. For example:\n\n```Python\ntry:\n    raise Exception(\n        \"more information: https://github.com/jdkandersson/flake8-error-link#fix-eli004\"\n    )\nexcept Exception:\n    raise\n```\n\nThis example can be fixed by using something like:\n\n```Python\ntry:\n    raise Exception(\n        \"more information: https://github.com/jdkandersson/flake8-error-link#fix-eli004\"\n    )\nexcept Exception as exc:\n    raise Exception(\n        \"more information: https://github.com/jdkandersson/flake8-error-link#fix-eli004\"\n    ) from exc\n```\n\nThis rule can be spurious at times if an exception is re-raisesd that already\nhas a more information link. Regardless, it is usually a good idea to include a\nspecific link for a problem. The context is usually different when an exception\nis re-raised so it could be useful to include documentation for that context\nrather then relying on any link provided by the original exception.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdkandersson%2Fflake8-error-link","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdkandersson%2Fflake8-error-link","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdkandersson%2Fflake8-error-link/lists"}