{"id":21980047,"url":"https://github.com/parafoxia/len8","last_synced_at":"2025-04-30T04:36:14.001Z","repository":{"id":45454890,"uuid":"389793789","full_name":"parafoxia/len8","owner":"parafoxia","description":"A utility for keeping line lengths within PEP 8 standards.","archived":false,"fork":false,"pushed_at":"2022-10-12T19:12:42.000Z","size":95,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-09-18T03:29:51.779Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/parafoxia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-26T23:22:33.000Z","updated_at":"2022-02-21T22:57:05.000Z","dependencies_parsed_at":"2022-08-02T13:30:42.590Z","dependency_job_id":null,"html_url":"https://github.com/parafoxia/len8","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parafoxia%2Flen8","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parafoxia%2Flen8/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parafoxia%2Flen8/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parafoxia%2Flen8/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parafoxia","download_url":"https://codeload.github.com/parafoxia/len8/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227174143,"owners_count":17742399,"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":"2024-11-29T17:09:23.738Z","updated_at":"2024-11-29T17:09:24.516Z","avatar_url":"https://github.com/parafoxia.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# len8\n\n\n[![PyPi version](https://img.shields.io/pypi/v/len8.svg)](https://pypi.python.org/pypi/len8/)\n[![PyPI - Status](https://img.shields.io/pypi/status/len8)](https://pypi.python.org/pypi/len8/)\n[![GitHub last commit](https://img.shields.io/github/last-commit/parafoxia/len8)](https://github.com/parafoxia/len8)\n[![License](https://img.shields.io/github/license/parafoxia/len8.svg)](https://github.com/parafoxia/len8/blob/main/LICENSE)\n\n[![CI](https://github.com/parafoxia/len8/actions/workflows/ci.yml/badge.svg)](https://github.com/parafoxia/len8/actions/workflows/ci.yml)\n[![Maintainability](https://api.codeclimate.com/v1/badges/9ec0deb12d512a60e6af/maintainability)](https://codeclimate.com/github/parafoxia/len8/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/9ec0deb12d512a60e6af/test_coverage)](https://codeclimate.com/github/parafoxia/len8/test_coverage)\n[![Downloads](https://pepy.tech/badge/len8)](https://pepy.tech/project/len8)\n\nA utility for keeping line lengths within [PEP 8](https://www.python.org/dev/peps/pep-0008/#maximum-line-length) standards.\n\n## Features\n\n- An easy-to-use CLI (command-line interface)\n- Check a single file, directory, or multiple files and directories\n- Exclude files and directories from being checked\n- Set different maximum lengths for both code and documentation\n- Minimal dependencies\n\n## Installation\n\n**You need Python 3.6.0 or greater to run len8.**\n\nTo install the latest stable version of len8, use the following command:\n```sh\npip install len8\n```\n\nYou can also install the latest development version using the following command:\n```sh\npip install git+https://github.com/parafoxia/len8\n```\n\nYou may need to prefix these commands with a call to the Python interpreter depending on your OS and Python configuration.\n\n## Quickstart\n\nTo get started checking your Python projects with len8:\n\n#### Using the terminal\n\n```sh\n# Check all files in the CWD\nlen8 .\n\n# Check all files in `tests` directory and `stats.py` file in CWD\nlen8 tests stats.py\n\n# Check all files in two particular directories\nlen8 my_package tests\n\n# Excluding file 'config.py' and directory 'secrets'\n# By default '.venv', 'venv', and '.nox' are excluded\nlen8 -x config.py,secrets .\n\n# Check 'project' dir and increase maximum allowed line lengths\n# Note that line lengths for comments and docs stay at 72\nlen8 -l project         # Increase to 88 (black's default)\nlen8 -ll /home/project  # Increase to 99 (max allowed by PEP 8)\n\n# Check using custom line lengths\nlen8 -c 150 .     # Increase code to 150\nlen8 -d 100 .     # Increase docs to 100\nlen8 -ll -d 99 .  # Increase code and docs to 99\n\n# Check only one file 'important.py'\nlen8 important.py\nlen8 ./dir/important.py\n\n# Check using multiple flags at once\nlen8 -lx ignoreme.py ./project_dir\n```\n\n#### In a Python script\n\n```py\nfrom len8 import Checker\n\n# Instantiate a new Checker, with strict mode set to True\nchecker = Checker(strict=True)\n\n# Set attributes after instantiation\nchecker.extend = 2\nchecker.exclude = [\"excluded_dir\"]\nchecker.strict = False\n\n# Set line lengths after instantiation\nchecker.set_lengths(code=100, docs=80)\n\n# Checks everything in the cwd\nbad_lines = checker.check(\".\")\n\n# Because strict mode is set to False and no error is raised, we\n# print the returned value from the check method\nprint(bad_lines)\n```\n\n## Configuration\n\nlen8 supports toml configuration files, by default `pyproject.toml` in your project\nroot will be used. You may specify a different configuration file via the `--config`\ncli flag.\n\n#### Available configuration options:\n- `include`: An array of files/directories len8 should check.\n- `exclude`: An array of files/directories to exclude from checking.\n- `code-length`: The maximum line length for code.\n- `docs-length`: The maximum line length for comments and documentation.\n- `strict`: Whether or not len8 should raise an exception if lines are too long.\n\n```toml\n[tool.len8]\ninclude = [\"myapp\"]\nexclude = [\"secrets\", \"testing\"]\ncode-length = 88\ndocs-length = 69\nstrict = true\n```\n\nIt's easy to take advantage of configuration files from a Python script as well.\n\n```py\nfrom len8 import Checker, Config\n\n# Valid\nchecker = Checker.from_config(\"./myconfig.toml\")\n\n# Also valid\ncfg = Config(\"./myconfig.toml\")\nchecker = Checker.from_config(cfg)\n```\n\n## Contributing\n\nlen8 is open to contributions. To find out where to get started, have a look at the [contributing guide](https://github.com/parafoxia/len8/blob/main/CONTRIBUTING.md).\n\n## License\n\nThe len8 module for Python is licensed under the [BSD 3-Clause License](https://github.com/parafoxia/len8/blob/main/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparafoxia%2Flen8","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparafoxia%2Flen8","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparafoxia%2Flen8/lists"}