mirror of
https://github.com/digital-asset/daml.git
synced 2024-11-10 10:46:11 +03:00
87cd22efb5
* 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.
49 lines
1.4 KiB
YAML
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]
|
|
|