Skip to content

Commit

Permalink
Merge pull request #244 from well-typed/edsko/cleanup-proto
Browse files Browse the repository at this point in the history
Cleanup proto generation
  • Loading branch information
edsko authored Oct 24, 2024
2 parents 4c1c976 + 5f95d65 commit 4c8402f
Show file tree
Hide file tree
Showing 39 changed files with 139 additions and 156 deletions.
File renamed without changes.
File renamed without changes.
50 changes: 50 additions & 0 deletions dev/genproto.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash

##
## grpc-spec, definitions from the main gRPC repo
##

for i in proto/official/grpc-spec/*
do
protoc \
--plugin=protoc-gen-haskell=`which proto-lens-protoc` \
--haskell_out=grpc-spec/proto \
--proto_path=proto/official/grpc-spec \
$i
done

##
## test-grapesy, definitions from the main gRPC repo
##

for i in proto/official/test-grapesy/*
do
protoc \
--plugin=protoc-gen-haskell=`which proto-lens-protoc` \
--haskell_out=grapesy/proto \
--proto_path=proto/official/test-grapesy \
$i
done

##
## test-grapesy, bespoke definitions
##

for i in proto/bespoke/test-grapesy/*
do
protoc \
--plugin=protoc-gen-haskell=`which proto-lens-protoc` \
--haskell_out=grapesy/proto \
--proto_path=proto/bespoke/test-grapesy \
$i
done

##
## Disable some warnings in the generated modules, so that we can keep these
## warnings enabled for the test suite.
##

for i in grpc-spec/proto/Proto/*.hs grapesy/proto/Proto/*.hs
do
sed -i '1i{-# OPTIONS_GHC -Wno-prepositive-qualified-module -Wno-identities #-}' $i
done
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
36 changes: 0 additions & 36 deletions grapesy/dev/genproto.sh

This file was deleted.

31 changes: 0 additions & 31 deletions grapesy/docs/internals.md

This file was deleted.

2 changes: 1 addition & 1 deletion grapesy/proto/Proto/Empty.hs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{-# OPTIONS_GHC -Wno-prepositive-qualified-module -Wno-identities #-}
{- This file was auto-generated from empty.proto by the proto-lens-protoc program. -}
{-# LANGUAGE ScopedTypeVariables, DataKinds, TypeFamilies, UndecidableInstances, GeneralizedNewtypeDeriving, MultiParamTypeClasses, FlexibleContexts, FlexibleInstances, PatternSynonyms, MagicHash, NoImplicitPrelude, DataKinds, BangPatterns, TypeApplications, OverloadedStrings, DerivingStrategies#-}
{-# OPTIONS_GHC -Wno-unused-imports#-}
{-# OPTIONS_GHC -Wno-duplicate-exports#-}
{-# OPTIONS_GHC -Wno-dodgy-exports#-}
{-# OPTIONS_GHC -Wno-prepositive-qualified-module #-}
module Proto.Empty (
Empty()
) where
Expand Down
2 changes: 1 addition & 1 deletion grapesy/proto/Proto/Empty_Fields.hs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{-# OPTIONS_GHC -Wno-prepositive-qualified-module -Wno-identities #-}
{- This file was auto-generated from empty.proto by the proto-lens-protoc program. -}
{-# LANGUAGE ScopedTypeVariables, DataKinds, TypeFamilies, UndecidableInstances, GeneralizedNewtypeDeriving, MultiParamTypeClasses, FlexibleContexts, FlexibleInstances, PatternSynonyms, MagicHash, NoImplicitPrelude, DataKinds, BangPatterns, TypeApplications, OverloadedStrings, DerivingStrategies#-}
{-# OPTIONS_GHC -Wno-unused-imports#-}
{-# OPTIONS_GHC -Wno-duplicate-exports#-}
{-# OPTIONS_GHC -Wno-dodgy-exports#-}
{-# OPTIONS_GHC -Wno-prepositive-qualified-module #-}
module Proto.Empty_Fields where
import qualified Data.ProtoLens.Runtime.Prelude as Prelude
import qualified Data.ProtoLens.Runtime.Data.Int as Data.Int
Expand Down
6 changes: 3 additions & 3 deletions grapesy/proto/Proto/Helloworld.hs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{-# OPTIONS_GHC -Wno-prepositive-qualified-module -Wno-identities #-}
{- This file was auto-generated from helloworld.proto by the proto-lens-protoc program. -}
{-# LANGUAGE ScopedTypeVariables, DataKinds, TypeFamilies, UndecidableInstances, GeneralizedNewtypeDeriving, MultiParamTypeClasses, FlexibleContexts, FlexibleInstances, PatternSynonyms, MagicHash, NoImplicitPrelude, DataKinds, BangPatterns, TypeApplications, OverloadedStrings, DerivingStrategies#-}
{-# OPTIONS_GHC -Wno-unused-imports#-}
{-# OPTIONS_GHC -Wno-duplicate-exports#-}
{-# OPTIONS_GHC -Wno-dodgy-exports#-}
{-# OPTIONS_GHC -Wno-prepositive-qualified-module #-}
module Proto.Helloworld (
Greeter(..), HelloReply(), HelloRequest()
) where
Expand Down Expand Up @@ -33,7 +33,7 @@ import qualified Data.ProtoLens.Runtime.Data.Vector.Generic as Data.Vector.Gener
import qualified Data.ProtoLens.Runtime.Data.Vector.Unboxed as Data.Vector.Unboxed
import qualified Data.ProtoLens.Runtime.Text.Read as Text.Read
{- | Fields :
* 'Proto.Helloworld_Fields.message' @:: Lens' HelloReply Data.Text.Text@ -}
data HelloReply
= HelloReply'_constructor {_HelloReply'message :: !Data.Text.Text,
Expand Down Expand Up @@ -145,7 +145,7 @@ instance Control.DeepSeq.NFData HelloReply where
(_HelloReply'_unknownFields x__)
(Control.DeepSeq.deepseq (_HelloReply'message x__) ())
{- | Fields :
* 'Proto.Helloworld_Fields.name' @:: Lens' HelloRequest Data.Text.Text@ -}
data HelloRequest
= HelloRequest'_constructor {_HelloRequest'name :: !Data.Text.Text,
Expand Down
2 changes: 1 addition & 1 deletion grapesy/proto/Proto/Helloworld_Fields.hs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{-# OPTIONS_GHC -Wno-prepositive-qualified-module -Wno-identities #-}
{- This file was auto-generated from helloworld.proto by the proto-lens-protoc program. -}
{-# LANGUAGE ScopedTypeVariables, DataKinds, TypeFamilies, UndecidableInstances, GeneralizedNewtypeDeriving, MultiParamTypeClasses, FlexibleContexts, FlexibleInstances, PatternSynonyms, MagicHash, NoImplicitPrelude, DataKinds, BangPatterns, TypeApplications, OverloadedStrings, DerivingStrategies#-}
{-# OPTIONS_GHC -Wno-unused-imports#-}
{-# OPTIONS_GHC -Wno-duplicate-exports#-}
{-# OPTIONS_GHC -Wno-dodgy-exports#-}
{-# OPTIONS_GHC -Wno-prepositive-qualified-module #-}
module Proto.Helloworld_Fields where
import qualified Data.ProtoLens.Runtime.Prelude as Prelude
import qualified Data.ProtoLens.Runtime.Data.Int as Data.Int
Expand Down
4 changes: 2 additions & 2 deletions grapesy/proto/Proto/Kvstore.hs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{-# OPTIONS_GHC -Wno-prepositive-qualified-module -Wno-identities #-}
{- This file was auto-generated from kvstore.proto by the proto-lens-protoc program. -}
{-# LANGUAGE ScopedTypeVariables, DataKinds, TypeFamilies, UndecidableInstances, GeneralizedNewtypeDeriving, MultiParamTypeClasses, FlexibleContexts, FlexibleInstances, PatternSynonyms, MagicHash, NoImplicitPrelude, DataKinds, BangPatterns, TypeApplications, OverloadedStrings, DerivingStrategies#-}
{-# OPTIONS_GHC -Wno-unused-imports#-}
{-# OPTIONS_GHC -Wno-duplicate-exports#-}
{-# OPTIONS_GHC -Wno-dodgy-exports#-}
{-# OPTIONS_GHC -Wno-prepositive-qualified-module #-}
module Proto.Kvstore (
KeyValueService(..), CreateRequest(), CreateResponse(),
DeleteRequest(), DeleteResponse(), RetrieveRequest(),
Expand Down Expand Up @@ -1081,4 +1081,4 @@ packedFileDescriptor
\\f\n\
\\ENQ\ACK\NUL\STX\ETX\STX\DC2\ETX*\r\SUB\n\
\\f\n\
\\ENQ\ACK\NUL\STX\ETX\ETX\DC2\ETX*%3b\ACKproto3"
\\ENQ\ACK\NUL\STX\ETX\ETX\DC2\ETX*%3b\ACKproto3"
4 changes: 2 additions & 2 deletions grapesy/proto/Proto/Kvstore_Fields.hs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{-# OPTIONS_GHC -Wno-prepositive-qualified-module -Wno-identities #-}
{- This file was auto-generated from kvstore.proto by the proto-lens-protoc program. -}
{-# LANGUAGE ScopedTypeVariables, DataKinds, TypeFamilies, UndecidableInstances, GeneralizedNewtypeDeriving, MultiParamTypeClasses, FlexibleContexts, FlexibleInstances, PatternSynonyms, MagicHash, NoImplicitPrelude, DataKinds, BangPatterns, TypeApplications, OverloadedStrings, DerivingStrategies#-}
{-# OPTIONS_GHC -Wno-unused-imports#-}
{-# OPTIONS_GHC -Wno-duplicate-exports#-}
{-# OPTIONS_GHC -Wno-dodgy-exports#-}
{-# OPTIONS_GHC -Wno-prepositive-qualified-module #-}
module Proto.Kvstore_Fields where
import qualified Data.ProtoLens.Runtime.Prelude as Prelude
import qualified Data.ProtoLens.Runtime.Data.Int as Data.Int
Expand Down Expand Up @@ -37,4 +37,4 @@ value ::
forall f s a.
(Prelude.Functor f, Data.ProtoLens.Field.HasField s "value" a) =>
Lens.Family2.LensLike' f s a
value = Data.ProtoLens.Field.field @"value"
value = Data.ProtoLens.Field.field @"value"
Loading

0 comments on commit 4c8402f

Please sign in to comment.