
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.
Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.
A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.
This commit was automatically created and can be verified using
nix-build a08b3a4d19
.tar.gz \
--argstr baseRev b32a0943687d2a5094a6d92f25a4b6e16a76b5b7
result/bin/apply-formatting $NIXPKGS_PATH
37 lines
1.6 KiB
Nix
37 lines
1.6 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
nanopb,
|
|
}:
|
|
|
|
stdenv.mkDerivation {
|
|
name = "nanopb-test-message-with-annotations";
|
|
meta.timeout = 60;
|
|
src = lib.fileset.toSource {
|
|
root = ./.;
|
|
fileset = lib.fileset.unions [ ./withannotations.proto ];
|
|
};
|
|
|
|
buildInputs = [ nanopb ];
|
|
|
|
# protoc requires any .proto file to be compiled to reside within it's
|
|
# proto_path. By default the current directory is automatically added to the
|
|
# proto_path. I tried using --proto_path ${./.} ${./simple.proto} and it did
|
|
# not work because they end up in the store at different locations.
|
|
dontInstall = true;
|
|
buildPhase = ''
|
|
mkdir $out
|
|
|
|
protoc --proto_path=. --proto_path=${nanopb}/share/nanopb/generator/proto --plugin=protoc-gen-nanopb=${nanopb}/bin/protoc-gen-nanopb --nanopb_out=$out withannotations.proto
|
|
'';
|
|
|
|
doCheck = true;
|
|
checkPhase = ''
|
|
grep -q WithAnnotations $out/withannotations.pb.c || (echo "error: WithAnnotations not found in $out/withannotations.pb.c"; exit 1)
|
|
grep -q WithAnnotations $out/withannotations.pb.h || (echo "error: WithAnnotations not found in $out/withannotations.pb.h"; exit 1)
|
|
grep -q "pb_byte_t uuid\[16\]" $out/withannotations.pb.h || (echo "error: uuid is not of type pb_byte_t and of size 16 in $out/withannotations.pb.h"; exit 1)
|
|
grep -q "FIXED_LENGTH_BYTES, uuid" $out/withannotations.pb.h || (echo "error: uuid is not of fixed lenght bytes in $out/withannotations.pb.h"; exit 1)
|
|
grep -q "#define WithAnnotations_size" $out/withannotations.pb.h || (echo "error: the size of WithAnnotations is not known in $out/withannotations.pb.h"; exit 1)
|
|
'';
|
|
}
|