daml/.pre-commit-config.yaml
Claudio Bley 87cd22efb5
Fix pre-commmit "pprettier" check (#15894)
* Also include `tsx` files in pre-commmit "pprettier" check

* Fix error from "pprettier" pre-commmit check for a single file

The first argument was actually skipped and the tool spits out an ugly error.
2023-01-10 16:40:16 +00:00

49 lines
1.4 KiB
YAML

# Copyright (c) 2023 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: local
hooks:
- id: hlint
name: hlint
language: system
entry: "hlint -j"
require_serial: true
types: [haskell]
- id: scalafmt
name: scalafmt
language: system
require_serial: true
entry: "scalafmt --respect-project-filters"
types: [scala]
- id: javafmt
name: javafmt
language: system
require_serial: true
entry: "javafmt --set-exit-if-changed --replace"
types: [java]
- id: buildifier
name: buildifier
language: system
require_serial: true
entry: "bazel run //:buildifier-pre-commit -- -mode=fix -v=true"
types: [bazel]
- id: pprettier
name: pprettier
language: system
require_serial: true
# NB: we need to pass a single argument which ends up in $0 when invoking bash -c
entry: "bash -c 'yarn install --silent && yarn run pprettier --write \"$@\"' bash"
types_or: [ts, tsx]
- id: copyrights
name: copyright headers
description: Idempotently add DA copyright headers to source files.
language: system
pass_filenames: false
entry: "dade-copyright-headers update"
types: [text]