Skip to content

Commit

Permalink
Accept hypothetical Protobuf Editions files.
Browse files Browse the repository at this point in the history
It will not accept actual Protobuf Editions files by restricting
the supported edition to `LEGACY`.  This restriction will be
lifted once support for edition 2023 is complete.
  • Loading branch information
chungyc authored and blackgnezdo committed Sep 16, 2024
1 parent b59b6ea commit 72d67a1
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 225 deletions.
5 changes: 3 additions & 2 deletions proto-lens-protoc/app/protoc-gen-haskell.hs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ makeResponse dflags prog request = let
in defMessage
& #supportedFeatures .~
(foldl (.|.) zeroBits $ fmap (toEnum . fromEnum) features)
& #minimumEdition .~ fromIntegral (fromEnum EDITION_2023)
& #maximumEdition .~ fromIntegral (fromEnum EDITION_2023)
-- Do not process actual Protobuf Editions files yet.
& #minimumEdition .~ fromIntegral (fromEnum EDITION_LEGACY)
& #maximumEdition .~ fromIntegral (fromEnum EDITION_LEGACY)
& #file .~ [ defMessage
& #name .~ outputName
& #content .~ outputContent
Expand Down
9 changes: 0 additions & 9 deletions proto-lens-tests/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,6 @@ tests:
- Proto.Canonical
- Proto.Canonical_Fields

editions2023_test:
main: editions2023_test.hs
source-dirs: tests
dependencies:
- proto-lens-tests
generated-other-modules:
- Proto.Editions2023
- Proto.Editions2023_Fields

group_test:
main: group_test.hs
source-dirs: tests
Expand Down
31 changes: 0 additions & 31 deletions proto-lens-tests/proto-lens-tests.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -234,37 +234,6 @@ test-suite descriptor_test
, text
default-language: Haskell2010

test-suite editions2023_test
type: exitcode-stdio-1.0
main-is: editions2023_test.hs
other-modules:
Paths_proto_lens_tests
Proto.Editions2023
Proto.Editions2023_Fields
autogen-modules:
Paths_proto_lens_tests
Proto.Editions2023
Proto.Editions2023_Fields
hs-source-dirs:
tests
build-tool-depends:
proto-lens-protoc:proto-lens-protoc
build-depends:
QuickCheck
, base
, bytestring
, lens-family
, pretty
, proto-lens
, proto-lens-arbitrary
, proto-lens-runtime
, proto-lens-tests
, tasty
, tasty-hunit
, tasty-quickcheck
, text
default-language: Haskell2010

test-suite enum_test
type: exitcode-stdio-1.0
main-is: enum_test.hs
Expand Down
44 changes: 0 additions & 44 deletions proto-lens-tests/tests/editions2023.proto

This file was deleted.

139 changes: 0 additions & 139 deletions proto-lens-tests/tests/editions2023_test.hs

This file was deleted.

0 comments on commit 72d67a1

Please sign in to comment.