{"id":13734179,"url":"https://github.com/atugushev/flake8-printf-formatting","last_synced_at":"2025-03-22T08:30:52.621Z","repository":{"id":54753534,"uuid":"206999285","full_name":"atugushev/flake8-printf-formatting","owner":"atugushev","description":"flake8 plugin that forbids printf-style string formatting","archived":false,"fork":false,"pushed_at":"2021-10-12T05:36:31.000Z","size":35,"stargazers_count":11,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-15T03:34:53.155Z","etag":null,"topics":["flake8","flake8-plugin","formatting","printf","qa","quality-assurance"],"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/atugushev.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}},"created_at":"2019-09-07T17:00:51.000Z","updated_at":"2022-05-29T11:45:53.000Z","dependencies_parsed_at":"2022-08-14T01:50:25.228Z","dependency_job_id":null,"html_url":"https://github.com/atugushev/flake8-printf-formatting","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atugushev%2Fflake8-printf-formatting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atugushev%2Fflake8-printf-formatting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atugushev%2Fflake8-printf-formatting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atugushev%2Fflake8-printf-formatting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atugushev","download_url":"https://codeload.github.com/atugushev/flake8-printf-formatting/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244931411,"owners_count":20534005,"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":["flake8","flake8-plugin","formatting","printf","qa","quality-assurance"],"created_at":"2024-08-03T03:00:53.224Z","updated_at":"2025-03-22T08:30:52.368Z","avatar_url":"https://github.com/atugushev.png","language":"Python","readme":"[![PyPI version](https://img.shields.io/pypi/v/flake8-printf-formatting.svg)](https://pypi.org/project/flake8-printf-formatting/)\n[![Supported Python versions](https://img.shields.io/pypi/pyversions/flake8-printf-formatting.svg)](https://pypi.org/project/flake8-printf-formatting/)\n![Tests](https://github.com/atugushev/flake8-printf-formatting/workflows/Tests/badge.svg)\n[![Coverage](https://codecov.io/gh/atugushev/flake8-printf-formatting/branch/master/graph/badge.svg)](https://codecov.io/gh/atugushev/flake8-printf-formatting)\n\nflake8-printf-formatting\n========================\n\nflake8 plugin which forbids printf-style string formatting\n\n## Installation\n\n`pip install flake8-printf-formatting`\n\n## Codes\n\n| Code   | Description                               |\n|--------|-------------------------------------------|\n| MOD001 | do not use printf-style string formatting |\n\n## Rationale\n\nThe official Python 3 documentation [doesn't recommend](https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting)\nprintf-style string formatting:\n\n\u003e The formatting operations described here exhibit a variety of quirks that\n\u003e lead to a number of common errors (such as failing to display tuples and\n\u003e dictionaries correctly). Using the newer formatted string literals,\n\u003e the `str.format` interface, or template strings may help avoid these errors.\n\u003e Each of these alternatives provides their own trade-offs and benefits of simplicity,\n\u003e flexibility, and/or extensibility.\n\n### Bad\n\n```python\nprint(\"Hello, %s!\" % name)\n```\n\n### Good\n\n```python\nprint(\"Hello, {name}!\".format(name=name))\n```\n\n### Even better\n\n```python\nprint(f\"Hello, {name}!\")\n```\n\n## As a pre-commit hook\n\nSee [pre-commit](https://github.com/pre-commit/pre-commit) for instructions\n\nSample `.pre-commit-config.yaml`:\n\n```yaml\n-   repo: https://gitlab.com/pycqa/flake8\n    rev: 3.7.8\n    hooks:\n    -   id: flake8\n        additional_dependencies: [flake8-printf-formatting]\n```\n\n## Release process\n\n1. Bump version in `setup.cfg`.\n1. Add a commit \"Release vX.Y.Z\".\n1. Make sure checks still pass.\n1. [Draft a new release](https://github.com/atugushev/flake8-printf-formatting/releases/new) with a tag name \"X.Y.Z\" and describe changes which involved in the release.\n1. Publish the release.\n","funding_links":[],"categories":["Limitations"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatugushev%2Fflake8-printf-formatting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatugushev%2Fflake8-printf-formatting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatugushev%2Fflake8-printf-formatting/lists"}