mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-11 04:45:57 +03:00
parent
1c4ae5023d
commit
4d1249390e
27
buf.yaml
Normal file
27
buf.yaml
Normal file
@ -0,0 +1,27 @@
|
||||
# Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
version: v1beta1
|
||||
build:
|
||||
roots:
|
||||
- daml-lf/archive/src/main/protobuf/
|
||||
- daml-lf/transaction/src/main/protobuf/
|
||||
- ledger/ledger-configuration/protobuf/
|
||||
- ledger/participant-state/kvutils/src/main/protobuf/
|
||||
excludes:
|
||||
# We have to exclude these to avoid duplicate definitions of e.g. Unit within the same package.
|
||||
- daml-lf/archive/src/main/protobuf/com/daml/daml_lf_1_11/
|
||||
- daml-lf/archive/src/main/protobuf/com/daml/daml_lf_1_12/
|
||||
- daml-lf/archive/src/main/protobuf/com/daml/daml_lf_1_13/
|
||||
- daml-lf/archive/src/main/protobuf/com/daml/daml_lf_1_14/
|
||||
- daml-lf/archive/src/main/protobuf/com/digitalasset/
|
||||
|
||||
lint:
|
||||
use:
|
||||
- DEFAULT
|
||||
except:
|
||||
- PACKAGE_VERSION_SUFFIX
|
||||
|
||||
breaking:
|
||||
use:
|
||||
- WIRE_JSON
|
BIN
buf_image.bin
Normal file
BIN
buf_image.bin
Normal file
Binary file not shown.
1
dev-env/bin/buf
Symbolic link
1
dev-env/bin/buf
Symbolic link
@ -0,0 +1 @@
|
||||
../lib/dade-exec-nix-tool
|
14
fmt.sh
14
fmt.sh
@ -11,6 +11,11 @@ cd "$(dirname "$0")"
|
||||
# load the dev-env
|
||||
eval "$(dev-env/bin/dade-assist)"
|
||||
|
||||
# Location of reference image used for buf breaking check.
|
||||
# In case breaking changes have been introduced, running './fmt.sh --rebuild-buf-image' will
|
||||
# overwrite this image.
|
||||
buf_image="buf_image.bin"
|
||||
|
||||
## Config ##
|
||||
is_test=
|
||||
scalafmt_args=()
|
||||
@ -62,6 +67,7 @@ Usage: ./fmt.sh [options]
|
||||
Options:
|
||||
-h, --help: shows this help
|
||||
--test: only test for formatting changes, used by CI
|
||||
--rebuild-buf-image: rebuilds reference image used for buf breaking checks
|
||||
USAGE
|
||||
exit
|
||||
;;
|
||||
@ -79,6 +85,11 @@ USAGE
|
||||
scalafmt_args+=('--mode=diff' "--diff-branch=${merge_base}")
|
||||
diff_mode=true
|
||||
;;
|
||||
--rebuild-buf-image)
|
||||
shift
|
||||
run buf build -o "${buf_image}"
|
||||
exit
|
||||
;;
|
||||
*)
|
||||
echo "fmt.sh: unknown argument $1" >&2
|
||||
exit 1
|
||||
@ -144,6 +155,9 @@ run scalafmt "${scalafmt_args[@]:-}"
|
||||
# check for Bazel build files code formatting
|
||||
run bazel run "$buildifier_target"
|
||||
|
||||
# Run buf checks.
|
||||
run buf check breaking --against "${buf_image}"
|
||||
|
||||
# Note that we cannot use a symlink here because Windows.
|
||||
if ! diff .bazelrc compatibility/.bazelrc >/dev/null; then
|
||||
echo ".bazelrc and compatibility/.bazelrc are out of sync:"
|
||||
|
@ -78,6 +78,8 @@ in rec {
|
||||
|
||||
javafmt = pkgs.callPackage ./tools/google-java-format {};
|
||||
|
||||
buf = pkgs.buf;
|
||||
|
||||
scala = bazel_dependencies.scala_2_13;
|
||||
fsc = scala;
|
||||
scalac = scala;
|
||||
|
Loading…
Reference in New Issue
Block a user