{"id":13771424,"url":"https://github.com/wbolster/black-macchiato","last_synced_at":"2025-09-12T16:33:12.789Z","repository":{"id":34080914,"uuid":"169400844","full_name":"wbolster/black-macchiato","owner":"wbolster","description":"paints part of your python code black","archived":false,"fork":false,"pushed_at":"2022-06-04T19:03:16.000Z","size":29,"stargazers_count":70,"open_issues_count":7,"forks_count":10,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-02T17:03:58.900Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wbolster.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.rst","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-06T12:13:55.000Z","updated_at":"2024-10-09T20:37:39.000Z","dependencies_parsed_at":"2022-08-26T10:25:23.458Z","dependency_job_id":null,"html_url":"https://github.com/wbolster/black-macchiato","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wbolster%2Fblack-macchiato","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wbolster%2Fblack-macchiato/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wbolster%2Fblack-macchiato/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wbolster%2Fblack-macchiato/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wbolster","download_url":"https://codeload.github.com/wbolster/black-macchiato/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232761557,"owners_count":18572774,"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-08-03T17:00:51.356Z","updated_at":"2025-01-06T17:46:16.128Z","avatar_url":"https://github.com/wbolster.png","language":"Python","funding_links":[],"categories":["Improvements and wrappers"],"sub_categories":[],"readme":"===============\nblack-macchiato\n===============\n\n.. image:: https://circleci.com/gh/wbolster/black-macchiato.svg?style=svg\n    :target: https://circleci.com/gh/wbolster/black-macchiato\n\n| I see some Python and I want it painted black\n| — *Mick Jagger (The Rolling Stones)*\n\nWhat?\n=====\n\nThis is a small utility built on top of the `black`__ Python code\nformatter to enable formatting of partial files.\n\n__ https://github.com/python/black\n\nWhy?\n====\n\nPython code should be black, just like coffee. However, sometimes\nother people insist on adding milk for unexplicable reasons. Since\n`caffè latte`__ is undrinkable, you eventually settle for `caffè\nmacchiato`__ as a compromise.\n\n__ https://en.wikipedia.org/wiki/Latte\n__ https://en.wikipedia.org/wiki/Caff%C3%A8_macchiato\n\nIn other words, you want to use ``black`` for the code you write, but\nfor some reason you cannot convert whole files, e.g. when contributing\nto upstream codebases that are not under your complete control.\n\nHowever, partial formatting is not supported by ``black`` itself, for\nvarious good reasons, and it won't be implemented either\n(`134`__, `142`__, `245`__, `370`__, `511`__).\n\n__ https://github.com/python/black/issues/134\n__ https://github.com/python/black/issues/142\n__ https://github.com/python/black/issues/245\n__ https://github.com/python/black/issues/370\n__ https://github.com/python/black/issues/511\n\nThis is where ``black-macchiato`` enters the stage. This tool is for\nthose who want to do partial formatting anyway. It also accepts\nindented blocks, which means that you can format an indented method\ninside a class, or a small block of code.\n\nNote that this tool is a stopgap measure, and you should avoid using it\nif you can.\n\nHow?\n====\n\nTo install, use::\n\n  pip install black-macchiato\n\nThe ``black-macchiato`` command reads from standard input, and writes\nto standard output. Any command line flags are forwarded to ``black``.\n\nAlternatively, you can invoke the module directly through the ``python``\nexecutable, which may be preferable depending on your setup. Use\n``python -m macchiato`` instead of ``black-macchiato`` in that case.\n\nExample::\n\n  $ echo \"    if True: print('hi')\" | black-macchiato\n      if True:\n          print(\"hi\")\n\nIntegrating this piping of input and output with your editor is left\nas an exercise to the reader. For instance, Vim users can use\n`vim-black-macchiato`__, and Emacs users can use `python-black.el`__.\n\n__ https://github.com/smbl64/vim-black-macchiato\n__ https://github.com/wbolster/emacs-python-black\n\nHistory\n=======\n\n- 1.3.0 (2020-05-14)\n\n  - Refactor so that wrapping functionality can be reused more easily (`7`__)\n\n    __ https://github.com/wbolster/black-macchiato/pull/7\n\n  - Use project config file, if any (`4`__, `7`__)\n\n    __ https://github.com/wbolster/black-macchiato/pull/4\n    __ https://github.com/wbolster/black-macchiato/pull/7\n\n  - Improved Vim integration (`6`__)\n\n    __ https://github.com/wbolster/black-macchiato/pull/6\n\n- 1.2.0 (2020-03-23)\n\n  - Handle else/elif/except/finally and indented functions better (`5`__)\n\n    __ https://github.com/wbolster/black-macchiato/pull/5\n\n- 1.1.0 (2019-05-17)\n\n  - Handle lines ending with a colon\n  - Add tests\n\n- 1.0.1 (2019-02-06)\n\n  - Add more metadata\n\n- 1.0.0 (2019-02-06)\n\n  - Initial release\n\nLicense\n=======\n\nBSD. See ``LICENSE.rst``.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwbolster%2Fblack-macchiato","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwbolster%2Fblack-macchiato","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwbolster%2Fblack-macchiato/lists"}