From 199db9ba2afe66589825944c57b86607b310d3a7 Mon Sep 17 00:00:00 2001 From: Thanh Ha Date: Tue, 9 Jul 2019 22:24:40 -0400 Subject: [PATCH] Use prettier for auto formatting of JSON/YAML No more debate on which style to use, prettier is an opinionated style formatter for JSON and YAML files. Also standardize the pre-commit env name with other lfit projects. Signed-off-by: Thanh Ha Change-Id: I2655382ba6fb099970418475ad4cf939b11752e5 --- .pre-commit-config.yaml | 7 ++++++- tox.ini | 16 ++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ce05348..a496135 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,11 @@ --- repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v1.3.0 + rev: v2.2.1 hooks: - id: trailing-whitespace + + - repo: https://github.com/prettier/prettier + rev: 1.18.2 + hooks: + - id: prettier diff --git a/tox.ini b/tox.ini index d9ac9b4..d481df6 100644 --- a/tox.ini +++ b/tox.ini @@ -1,16 +1,10 @@ [tox] minversion = 1.6 envlist = - check-hooks, - coala + coala, + pre-commit skipsdist = true -[testenv:check-hooks] -deps = pre-commit~=1.11.2 -commands = - pre-commit install - pre-commit run --all-files - [testenv:coala] basepython = python3 deps = @@ -37,6 +31,12 @@ whitelist_externals = echo deps = -rrequirements.txt commands = sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck +[testenv:pre-commit] +deps = pre-commit +commands = + pre-commit install + pre-commit run --all-files + [testenv:reno] deps = -rdocs/requirements.txt commands = reno {posargs:--help} -- 2.16.6