Package: brunette
brunette🟤 A best practice Python code formatterThis is the "black" formatter but with some improvements:--configoption supportssetup.cfgformat.Where asingle-quotesoption enables single quotes as the preferred.--single-quotesoption to make single quotes the preferred.InstallationpipinstallbrunetteUsageUse in the same way you would the 'black' formatter.brunette**/*.py
brunette*.py--config=setup.cfg
brunette*.py--line-length=79--single-quotesExamplesetup.cfg:[tool:brunette]
line-length = 79
verbose = true
single-quotes = false
# etc, etc...This can also be combined with Flake8's configuration:[flake8]
# This section configures `flake8`, the python linting utility.
# See also https://flake8.pycqa.org/en/latest/user/configuration.html
ignore = E201,E202,E203
# E201 - whitespace after ‘(‘
# E202 - whitespace before ‘)’
# E203 - whitespace before ‘:’

# Exclude the git directory and virtualenv directory (as `.env`)
exclude = .git,.env

[tool:brunette]
line-length = 79
# etc, etc...Why does this need to exist?The current maintainer of Black,refusesto allow a single-quotes option. Due to his ownpersonalpreference (a preference which most of the Python community do not share).The current maintainer of Black,refusesto 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.The current configuration file format as adopted by Black may conflict with the newbuild isolationcontext withpip.  To avoid this, the use of asetup.cfgfile is preferred but the policy is under review by the maintainers (https://github.com/pypa/pip/issues/8437#issuecomment-644196428).How to configure in VSCodeGet the full path to your brunette installation. In your terminal type:which brunette(Linux)where brunette(Windows)In my case this looks like/home/work/.pyenv/shims/brunette. On Windows thats more likeC:\Python39\Scripts\brunette.exe. Now copy whatever that value is.\Open thesetttingsUI.Search forblack.Paste that path intoBlack Path.Setblackas the Python Formatting Provider.Add arguments as--single-quotesyou like to theBlack ArgsThat's it! Now whenever youformat your Python codebrunette will be used.How to configure with Pre-Commit (https://pre-commit.com)Runpip install pre-committo installAdd a local repo option for brunette in.pre-commit-config.yaml# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
  - repo: https://github.com/odwyersoftware/brunette
    rev: 0.2.7
    hooks:
      - id: brunette
  # Drop-in replacement for black with brunette
  # - repo: https://github.com/psf/black
  #   rev: stable
  #   hooks:
  #     - id: black
  #       language_version: python3.6
  - repo: https://gitlab.com/pycqa/flake8
    rev: 3.8.1
    hooks:
      - id: flake8Runpre-commit installto install the Git pre-commit hookRunpre-commit runto validate all filesRelease History0.2.8 (2022-11-07)Fixed setup.py description.0.2.7 (2022-05-30)Fix black version to black==21.12b0, versions above do not function.0.2.6 (2022-05-26)Fix black version to black<22.0.0, versions above do not function.0.2.5 (2022-03-30)Fix for black version22.1.0+.0.2.4 (2022-03-09)Fix for black breaking changeblack.find_project_root.0.2.3 (2022-03-01)Bugfix, require black>=21.5b10.2.2 (2021-10-26)Bugfix, support for "black" version >=21.0.2.1 (2021-10-01)Loosen requirements pin on "black" version.0.2.0 (2020-12-18)Adds--single-quotesCLI option.0.1.9 (2020-12-16)Bugfixes, fix black version to black==20.8b1.0.1.8 (2020-12-16)Bugfix for single-quote formatting not working.0.1.7 (2020-06-26)Fix configuration file reading when multiple option variable.Updatenormalize_string_quotesfrom black.0.1.6 (2020-06-26)Documentation updates.0.1.5 (2020-06-18)Documentation updates.0.1.4 (2020-06-16)Handle when setup.cfg is missing.0.1.3 (2020-06-16)Handle when setup.cfg is missing.0.1.2 (2020-06-16)Added__main__for CLI exec.0.1.1 (2020-06-15)Adds wheels.0.1.0 (2020-06-15)Initial release.