{"id":37081128,"url":"https://github.com/ghazi-git/flake8-max-function-length","last_synced_at":"2026-01-14T09:51:15.276Z","repository":{"id":65962398,"uuid":"603488159","full_name":"ghazi-git/flake8-max-function-length","owner":"ghazi-git","description":"A configurable flake8 rule to enforce a maximum function/method length.","archived":false,"fork":false,"pushed_at":"2025-12-06T09:37:12.000Z","size":59,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-10T02:46:14.517Z","etag":null,"topics":["flake8","flake8-plugin","max-function-length"],"latest_commit_sha":null,"homepage":"","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/ghazi-git.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-02-18T17:03:53.000Z","updated_at":"2025-12-06T09:37:15.000Z","dependencies_parsed_at":"2025-08-11T18:27:14.522Z","dependency_job_id":"a2c17e11-abfe-4379-a233-16cbb1eae514","html_url":"https://github.com/ghazi-git/flake8-max-function-length","commit_stats":{"total_commits":19,"total_committers":1,"mean_commits":19.0,"dds":0.0,"last_synced_commit":"2ce80c833ec3b9bfe8aa178136034677e6513c4b"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/ghazi-git/flake8-max-function-length","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghazi-git%2Fflake8-max-function-length","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghazi-git%2Fflake8-max-function-length/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghazi-git%2Fflake8-max-function-length/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghazi-git%2Fflake8-max-function-length/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ghazi-git","download_url":"https://codeload.github.com/ghazi-git/flake8-max-function-length/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghazi-git%2Fflake8-max-function-length/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28416120,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:38:59.149Z","status":"ssl_error","status_checked_at":"2026-01-14T08:38:43.588Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["flake8","flake8-plugin","max-function-length"],"created_at":"2026-01-14T09:51:14.549Z","updated_at":"2026-01-14T09:51:15.268Z","avatar_url":"https://github.com/ghazi-git.png","language":"Python","readme":"# flake8-max-function-length\n\nA configurable [flake8](https://github.com/pycqa/flake8) plugin to enforce a maximum function/method length.\n\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/ghazi-git/flake8-max-function-length/tests.yml?branch=main\u0026label=Tests\u0026logo=GitHub)](https://github.com/ghazi-git/flake8-max-function-length/actions/workflows/tests.yml)\n[![PyPI](https://img.shields.io/pypi/v/flake8-max-function-length)](https://pypi.org/project/flake8-max-function-length/)\n[![PyPI](https://img.shields.io/pypi/pyversions/flake8-max-function-length?logo=python\u0026logoColor=white)](https://pypi.org/project/flake8-max-function-length/)\n[![PyPI - License](https://img.shields.io/pypi/l/flake8-max-function-length)](https://github.com/ghazi-git/flake8-max-function-length/blob/main/LICENSE)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n## Installation\n\nInstall with `pip`\n\n```shell\npip install flake8-max-function-length\n```\n\n## Configuration Options\n\nThe package has only one rule `MFL000` to check that function length is equal or lower to a maximum value.\nBy default, the function length should be lower than 50 lines and is calculated based on its content ignoring\nits docstring, comments and empty lines. Still, you have the ability to customize that based on the following\noptions:\n\n- `--max-function-length=n`: Maximum allowed function length. (Default: 50)\n- `--mfl-include-function-definition`: Include the function definition line(s) when calculating the function length.\n(Default: disabled)\n- `--mfl-include-docstring`: Include the length of the docstring when calculating the function length.\n(Default: disabled)\n- `--mfl-include-empty-lines`: Include empty lines inside the function when calculating the function length.\n(Default: disabled)\n- `--mfl-include-comment-lines`: Include comment lines when calculating the function length. (Default: disabled)\n\n## Usage with pre-commit\n\n```yaml\nrepos:\n  - repo: https://github.com/pycqa/flake8\n    rev: '6.0.0'\n    hooks:\n      - id: flake8\n        #args: [ --max-function-length, '100', --mfl-include-docstring, --mfl-include-comment-lines ]\n        additional_dependencies: [ \"flake8-max-function-length==0.10.0\" ]\n```\n\n## Similar tools\n\n- flake8-functions has a similar rule for maximum function length, however, it [doesn't allow excluding empty lines\nand comments](https://github.com/best-doctor/flake8-functions/issues/9).\n- Pylint has the [too-many-statements](https://pylint.readthedocs.io/en/latest/user_guide/checkers/features.html#design-checker-messages)\nrule, which is also similar to this one. Still, I find it easier to reason about number of lines as opposed to\nnumber of statements.\n\n## License\n\nThis project is [MIT licensed](LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghazi-git%2Fflake8-max-function-length","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghazi-git%2Fflake8-max-function-length","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghazi-git%2Fflake8-max-function-length/lists"}