{"id":13771454,"url":"https://github.com/odwyersoftware/brunette","last_synced_at":"2025-04-06T16:14:04.179Z","repository":{"id":42631384,"uuid":"271543226","full_name":"odwyersoftware/brunette","owner":"odwyersoftware","description":"🟤 A best practice Python code formatter","archived":false,"fork":false,"pushed_at":"2024-03-25T16:44:02.000Z","size":79,"stargazers_count":111,"open_issues_count":4,"forks_count":14,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-30T15:11:56.978Z","etag":null,"topics":["autopep8","black","code","codeformatter","formatter","gofmt","pyfmt","python","yapf"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/odwyersoftware.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":null,"funding":null,"license":null,"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":"2020-06-11T12:41:45.000Z","updated_at":"2025-02-21T09:42:50.000Z","dependencies_parsed_at":"2024-06-18T20:11:29.278Z","dependency_job_id":null,"html_url":"https://github.com/odwyersoftware/brunette","commit_stats":{"total_commits":106,"total_committers":13,"mean_commits":8.153846153846153,"dds":"0.39622641509433965","last_synced_commit":"698ea7162a9a70192ec3cd1d1b28b9ccdd3a613f"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odwyersoftware%2Fbrunette","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odwyersoftware%2Fbrunette/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odwyersoftware%2Fbrunette/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odwyersoftware%2Fbrunette/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/odwyersoftware","download_url":"https://codeload.github.com/odwyersoftware/brunette/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247509237,"owners_count":20950232,"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":["autopep8","black","code","codeformatter","formatter","gofmt","pyfmt","python","yapf"],"created_at":"2024-08-03T17:00:51.637Z","updated_at":"2025-04-06T16:14:04.162Z","avatar_url":"https://github.com/odwyersoftware.png","language":"Python","funding_links":[],"categories":["Improvements and wrappers"],"sub_categories":[],"readme":"# brunette\n\n🟤 A best practice Python code formatter\n\n[![PyPI version](https://badge.fury.io/py/brunette.svg)](https://pypi.org/project/brunette/)\n\nThis is the \"[black](https://github.com/psf/black)\" formatter but with some improvements:\n\n1. `--config` option supports `setup.cfg` format.\n    * Where a `single-quotes` option enables single quotes as the preferred.\n2. `--single-quotes` option to make single quotes the preferred.\n\n## Installation\n\n```bash\npip install brunette\n```\n\n## Usage\n\nUse in the same way you would the 'black' formatter.\n\n```bash\nbrunette **/*.py\nbrunette *.py --config=setup.cfg\nbrunette *.py --line-length=79 --single-quotes\n```\n\nExample `setup.cfg`:\n\n```\n[tool:brunette]\nline-length = 79\nverbose = true\nsingle-quotes = false\n# etc, etc...\n```\n\nThis can also be combined with Flake8's configuration:\n\n```\n[flake8]\n# This section configures `flake8`, the python linting utility.\n# See also https://flake8.pycqa.org/en/latest/user/configuration.html\nignore = E201,E202,E203\n# E201 - whitespace after ‘(‘\n# E202 - whitespace before ‘)’\n# E203 - whitespace before ‘:’\n\n# Exclude the git directory and virtualenv directory (as `.env`)\nexclude = .git,.env\n\n[tool:brunette]\nline-length = 79\n# etc, etc...\n```\n\n## Why does this need to exist?\n\n- The current maintainer of Black, [refuses](https://github.com/psf/black/pull/633#issuecomment-445477386) to allow a single-quotes option. Due to his own *personal* preference (a preference which most of the Python community do not share).\n\n- The current maintainer of Black, [refuses](https://github.com/psf/black/issues/683#issuecomment-542731068) to add setup.cfg support. Setup.cfg is the most widely used configuration file for Python projects. The maintainer of that library prefers \"pyproject.toml\" few people use at this time due to it's inflexibility and it requiring you to use Poetry, whatever that is.\n\n- The current configuration file format as adopted by Black may conflict with the new _build isolation_ context with `pip`.  To avoid this, the use of a `setup.cfg` file is preferred but the policy is under review by the maintainers (https://github.com/pypa/pip/issues/8437#issuecomment-644196428).\n\n## How to configure in VSCode\n\n1. Get the full path to your brunette installation. In your terminal type:\n  - `which brunette` (Linux)\n  - `where brunette` (Windows)\n\nIn my case this looks like `/home/work/.pyenv/shims/brunette`. On Windows thats more like `C:\\Python39\\Scripts\\brunette.exe`. Now copy whatever that value is.\\\n\n2. Open the [setttings](https://code.visualstudio.com/docs/getstarted/settings#_creating-user-and-workspace-settings) UI.\n\n3. Search for *black*.\n  - Paste that path into **Black Path**.\n  - Set `black` as the Python Formatting Provider.\n  - Add arguments as `--single-quotes` you like to the **Black Args**\n\n![https://i.imgur.com/6EXoamM.png](https://i.imgur.com/6EXoamM.png)\n\n3. That's it! Now whenever you [format your Python code](https://stackoverflow.com/a/48764668/13405802) brunette will be used.\n\n## How to configure with Pre-Commit (https://pre-commit.com)\n\n1. Run `pip install pre-commit` to install\n\n2. Add a local repo option for brunette in `.pre-commit-config.yaml`\n\n```\n# See https://pre-commit.com for more information\n# See https://pre-commit.com/hooks.html for more hooks\nrepos:\n  - repo: https://github.com/odwyersoftware/brunette\n    rev: 0.2.7\n    hooks:\n      - id: brunette\n  # Drop-in replacement for black with brunette\n  # - repo: https://github.com/psf/black\n  #   rev: stable\n  #   hooks:\n  #     - id: black\n  #       language_version: python3.6\n  - repo: https://gitlab.com/pycqa/flake8\n    rev: 3.8.1\n    hooks:\n      - id: flake8\n```\n\n3. Run `pre-commit install` to install the Git pre-commit hook\n\n3. Run `pre-commit run` to validate all files\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fodwyersoftware%2Fbrunette","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fodwyersoftware%2Fbrunette","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fodwyersoftware%2Fbrunette/lists"}