Skip to content

Commit

Permalink
style: format JSON, Markdown and YAML files with Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
markosamuli committed Feb 8, 2020
1 parent f5d5156 commit a3b7912
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ ansible.cfg
# IDEs
.vscode/*
!.vscode/cSpell.json
!.vscode/extensions.json

# pyenv
.python-version

!.prettierrc.yaml
30 changes: 21 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# -*- mode: yaml -*-
# vim:ts=2:sw=2:ai:si:syntax=yaml
---

minimum_pre_commit_version: 1.16.1

repos:
Expand All @@ -13,13 +12,26 @@ repos:
- id: check-case-conflict
- id: check-merge-conflict
- id: trailing-whitespace
args: ['--markdown-linebreak-ext=md']
args: ["--markdown-linebreak-ext=md"]
- id: end-of-file-fixer
- id: mixed-line-ending
args: ['--fix=lf']
args: ["--fix=lf"]
- id: check-yaml
- id: pretty-format-json
args: ['--autofix', '--indent=2', '--no-sort-keys']

# Format JSON, Markdown and YAML files with Prettier.
- repo: https://github.com/prettier/prettier
rev: "1.19.1"
hooks:
- id: prettier
name: Format JSON, Markdown and YAML files
files: "\\.(\
json\
|md|markdown|mdown|mkdn\
|yaml|yml\
)$"
# Do not run on Git push
stages: [commit]
verbose: false

- repo: https://github.com/adrienverge/yamllint.git
rev: v1.16.0
Expand All @@ -37,10 +49,10 @@ repos:
hooks:
- id: shellcheck
- id: shfmt
args: ['-l', '-i', '4', '-ci', '-w']
args: ["-l", "-i", "4", "-ci", "-w"]

- repo: https://github.com/openstack-dev/bashate.git
rev: '0.6.0'
rev: "0.6.0"
hooks:
- id: bashate
verbose: false
Expand All @@ -51,9 +63,9 @@ repos:
- id: markdownlint

- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook.git
rev: '2.0.0'
rev: "2.0.0"
hooks:
- id: commitlint
stages: [commit-msg]
additional_dependencies: ['@commitlint/config-conventional']
additional_dependencies: ["@commitlint/config-conventional"]
verbose: false
14 changes: 14 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# -*- mode: yaml -*-
# vim:ts=2:sw=2:ai:si:syntax=yaml
#
# Prettier configuration options:
# https://prettier.io/docs/en/options.html
---
printWidth: 80
tabWidth: 2
semi: true
singleQuote: false
useTabs: false
trailingComma: none
endOfLine: lf
proseWrap: preserve
14 changes: 14 additions & 0 deletions .vscode/.prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# -*- mode: yaml -*-
# vim:ts=2:sw=2:ai:si:syntax=yaml
#
# Prettier configuration options:
# https://prettier.io/docs/en/options.html
---
printWidth: 80
tabWidth: 4
semi: true
singleQuote: false
useTabs: false
trailingComma: none
endOfLine: lf
proseWrap: always

0 comments on commit a3b7912

Please sign in to comment.