All Projects → tox-dev → tox-ini-fmt

tox-dev / tox-ini-fmt

Licence: MIT License
Formats your tox.ini files

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to tox-ini-fmt

Konv
Secure P2P instant messenger. A new Tox client.
Stars: ✭ 50 (+163.16%)
Mutual labels:  tox
Fmt.jl
Python-style format strings for Julia
Stars: ✭ 31 (+63.16%)
Mutual labels:  formatter
unify
Modifies strings to all use the same quote where possible
Stars: ✭ 69 (+263.16%)
Mutual labels:  formatter
prettier-check
Check that all files match prettier code style.
Stars: ✭ 54 (+184.21%)
Mutual labels:  formatter
yapf-online
google/yapf online demo
Stars: ✭ 23 (+21.05%)
Mutual labels:  formatter
lucene
Node.js lib to transform: lucene query → syntax tree → lucene query
Stars: ✭ 61 (+221.05%)
Mutual labels:  formatter
touchdesigner-save-external
a simple save external tox and text helper
Stars: ✭ 42 (+121.05%)
Mutual labels:  tox
teks
Easily get custom go template based outputs to your command-line tool. Like in docker/kubernetes
Stars: ✭ 41 (+115.79%)
Mutual labels:  formatter
canonix
Experiment in Nix formatting
Stars: ✭ 18 (-5.26%)
Mutual labels:  formatter
pretty print formatter
Pretty Print Formatter for Elixir Logger module -- Colorize Ecto's SQL ouput 🖌️
Stars: ✭ 22 (+15.79%)
Mutual labels:  formatter
formatters
A javascript library for formatting and manipulating.
Stars: ✭ 14 (-26.32%)
Mutual labels:  formatter
lancer
Turn your python code into a hideous mess. Ever heard of Black? This is the opposite.
Stars: ✭ 179 (+842.11%)
Mutual labels:  formatter
vim-ormolu
Plugin for formatting Haskell source code
Stars: ✭ 35 (+84.21%)
Mutual labels:  formatter
AutoFormatInputWatcher
This repository contains input watcher for auto formatting digits in edit text
Stars: ✭ 15 (-21.05%)
Mutual labels:  formatter
prettier-eslint-atom
DEPRECATED IN FAVOR OF prettier-atom + ESLint integration
Stars: ✭ 64 (+236.84%)
Mutual labels:  formatter
ansible-coredns
Ansible provisioning of CoreDNS
Stars: ✭ 25 (+31.58%)
Mutual labels:  tox
intl-format
A wrapper library for PHP to format and internationalize values in messages like sprintf
Stars: ✭ 12 (-36.84%)
Mutual labels:  formatter
rustybot
A Tox groupchat trivia bot
Stars: ✭ 13 (-31.58%)
Mutual labels:  tox
dockerfile-utils
A library and command line interface for formatting and linting Dockerfiles.
Stars: ✭ 17 (-10.53%)
Mutual labels:  formatter
react-put
A flexible formatter and i18n interface for React.
Stars: ✭ 23 (+21.05%)
Mutual labels:  formatter

tox-ini-fmt

PyPI PyPI - Implementation PyPI - Python Version PyPI - Downloads PyPI - License check codecov Code style: black

apply a consistent format to tox.ini files

installation

pip install tox-ini-fmt

as a pre-commit hook

See pre-commit for instructions

Sample .pre-commit-config.yaml:

- repo: https://github.com/tox-dev/tox-ini-fmt
  rev: "0.3.0"
  hooks:
    - id: tox-ini-fmt
      args: ["-p", "fix_lint,type"]

cli

Consult the help for the latest usage:

$ tox-ini-fmt --help
usage: tox-ini-fmt [-h] [-s] [-p toxenv] tox_ini

positional arguments:
  tox_ini       tox ini file to format

optional arguments:
  -h, --help    show this help message and exit
  -s, --stdout  print the formatted text to the stdout (instead of update in-place)
  -p toxenv     tox environments that pin to the start of the envlist (comma separated)

what does it do?

It does not

  • Format any other section beside tox/testenv:* (other than put this sections to the end of the file)

General

  • boolean fields are normalized to true or false
  • all fields are stripped of white space on both end
  • values that contain a list are split one value per line (PR/merge friendly)
  • indent multi-line values by four spaces, and start on new line
  • substitutions within multi-line (excluding commands) are moved to the start of the list (order kept)

Ordering of sections

Applies the following section order:

  1. tox
  2. testenv
  3. testenv:* - py/pypy envs are ordered in decreasing order by python version, then apply the order defined within envlist part of tox section, you can pin tox elements to the start by using the -p flag
  4. any other section defined within the file

tox section

Order by:

  1. envlist - multi-line, start with py envs in decreasing python order, then same with pypy, then everything else
  2. isolated_build - boolean field
  3. skipsdist - boolean field
  4. skip_missing_interpreters - boolean field
  5. minversion

testenv section

Order by:

  1. description
  2. passenv - multi-line, one environment name to pass per line, sorted by name
  3. setenv - multi-line, one environment name-value to set per line in format of key=value, sorted by key+value
  4. basepython
  5. skip_install - boolean field
  6. usedevelop - boolean field
  7. deps - multi-line, order by package name (but keep dependencies with package names separate at end), normalize format to remove extra spaces
  8. extras - multi-line, one extra env per line
  9. parallel_show_output - boolean field
  10. commands - one command per line, commands that wrap over multiple lines are indented with line two or later by extra four spaces
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].