lint: Add Prettier as a linter for YAML files.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2020-07-01 12:20:07 -07:00
committed by Tim Abbott
parent 2794bc1ef4
commit 56e8cca025
4 changed files with 12 additions and 1 deletions

View File

@@ -93,6 +93,11 @@ def run() -> None:
linter_config.external_linter('isort', ['isort'], ['py'],
description="Sorts Python import statements",
check_arg=['--check-only', '--diff'])
linter_config.external_linter('prettier', ['node_modules/.bin/prettier'], ['yaml', 'yml'],
check_arg=['--check'], fix_arg=['--write'],
description="Formats YAML files",
# https://github.com/prettier/prettier/pull/8703
suppress_line=lambda line: line in ["Checking formatting...\n", "All matched files use Prettier code style!\n"])
semgrep_command = ["semgrep", "--config=./tools/semgrep.yml", "--error",
# This option is dangerous in the context of running