Open hughsimpson opened 3 years ago
Have you considered switching to some other libs?
On Fri, Aug 13, 2021, 6:03 PM hughsimpson @.***> wrote:
Lots of things still to figure out:
- Can't get defaults working. Man, I don't know what's up with that
- Assumes contructor methods are the only valid ones. This should be (compared to the above) fairly easy to fix
- I think there's some capability to declare bespoke config parsing? I haven't gone near that yet
You can view, comment on, or merge this pull request online at:
https://github.com/iheartradio/ficus/pull/158 Commit Summary
- some initial cross-compilation stuff
- wippery
- lol wip
File Changes
- M .scalafmt.conf https://github.com/iheartradio/ficus/pull/158/files#diff-88adef9b969d41ed5848ebca29ae7b61f25ed76010b0ed18079a8e2f06e195d8 (7)
- M build.sbt https://github.com/iheartradio/ficus/pull/158/files#diff-5634c415cd8c8504fdb973a3ed092300b43c4b8fc1e184f7249eb29a55511f91 (47)
- R src/main/scala-2/net/ceedubs/ficus/Ficus.scala https://github.com/iheartradio/ficus/pull/158/files#diff-98ad24a53dc6eaf8051f112d9c6605dcfcc78084d820ee38f4baf028e3717d5d (1)
- R src/main/scala-2/net/ceedubs/ficus/FicusConfig.scala https://github.com/iheartradio/ficus/pull/158/files#diff-2605b97fc4b78d9d2ad399ac62b26f69536fda4306d116aa040f495502dbf991 (5)
- R src/main/scala-2/net/ceedubs/ficus/readers/ArbitraryTypeReader.scala https://github.com/iheartradio/ficus/pull/158/files#diff-e5fb53060466b49b5965edea9491d68edb5d4691a4c9b2b5799e30e8cdaff852 (2)
- R src/main/scala-2/net/ceedubs/ficus/readers/EnumerationReader.scala https://github.com/iheartradio/ficus/pull/158/files#diff-a66ceb78ded7cc8954c1248dd9598b0b5ff54d4478afc396142d824ca741114a (0)
- R src/main/scala-2/net/ceedubs/ficus/util/ReflectionUtils.scala https://github.com/iheartradio/ficus/pull/158/files#diff-f2bd721520c00f9db6babf40b03da099a4e9ecc5ff81c7f9c3e014af6c57b13f (0)
- A src/main/scala-3/net/ceedubs/ficus/Ficus.scala https://github.com/iheartradio/ficus/pull/158/files#diff-b128d8f0ff26904f00cbd12aa67d8ba56326bf0ff8d3f92a01b16bcf578c6af1 (26)
- A src/main/scala-3/net/ceedubs/ficus/FicusConfig.scala https://github.com/iheartradio/ficus/pull/158/files#diff-7c87d88a7754b8869d6c76e1b940bfbd0b1de474d4f2c3a567a00f76819def39 (23)
- A src/main/scala-3/net/ceedubs/ficus/readers/ArbitraryTypeReader.scala https://github.com/iheartradio/ficus/pull/158/files#diff-1d724144054f9038233e619226bf88258a8fb74a5152c6ce0f47affb389cd555 (82)
- A src/main/scala-3/net/ceedubs/ficus/readers/CollectionReaders.scala https://github.com/iheartradio/ficus/pull/158/files#diff-4d5102de87477b27ffead97b9cd505a07aafdd8e2b7ada8df91c7e7af4637180 (41)
- A src/main/scala-3/net/ceedubs/ficus/readers/EnumerationReader.scala https://github.com/iheartradio/ficus/pull/158/files#diff-b264d84ea8406a0b1a62d39d8c9961efa897939b61a4aff34bb87bd6891e7c9c (5)
- A src/main/scala-3/net/ceedubs/ficus/util/ReflectionUtils.scala https://github.com/iheartradio/ficus/pull/158/files#diff-49f5b0a02e5e1dbe77a80f861d9670ff5e475badf6c21a021708e2b3fd5c3caf (61)
- M src/main/scala/net/ceedubs/ficus/readers/DurationReaders.scala https://github.com/iheartradio/ficus/pull/158/files#diff-86a51f1fb84914ede45d2ff4b39343897132e74daf35db4fc79b557f3525d07a (15)
- A src/main/scala/net/ceedubs/ficus/readers/Generated.scala https://github.com/iheartradio/ficus/pull/158/files#diff-8635b67c6ab082980290e5b1a7e6262071ea113b92fa20fe38df08fbbb4d58bc (3)
- M src/main/scala/net/ceedubs/ficus/readers/NameMapper.scala https://github.com/iheartradio/ficus/pull/158/files#diff-5d7464cfd32bc15be5430f723bf5afacce065070d6edd20b48b5a0c2d0a64751 (13)
- M src/main/scala/net/ceedubs/ficus/readers/ValueReader.scala https://github.com/iheartradio/ficus/pull/158/files#diff-536d15c04bc12f5313cc9622263c053a89029d7334a6f7c6244710f80cec447c (3)
- M src/test/scala-2.13+/net/ceedubs/ficus/Issue82Spec.scala https://github.com/iheartradio/ficus/pull/158/files#diff-4accb09bcd5eb0c5d903a9fcc83bfa2aa40ce7bbfe904308732f72864ef3065a (2)
- R src/test/scala-2/net/ceedubs/ficus/readers/EnumerationReadersSpec.scala https://github.com/iheartradio/ficus/pull/158/files#diff-a17ce9dad4a578e5c4d1aa257527732db69950501681bf96d62a3485559b4f61 (0)
- A src/test/scala-3/net/ceedubs/ficus/readers/EnumerationReadersSpec.scala https://github.com/iheartradio/ficus/pull/158/files#diff-0d8bcd1080f989d9742c6c124b73fe21aec7510ae7e9e080ffed7d4d71b99817 (65)
- M src/test/scala/net/ceedubs/ficus/ConfigSerializer.scala https://github.com/iheartradio/ficus/pull/158/files#diff-cdd86ce7b9ad4a49de074a474eb84e9f94115ef85876bc08016044bd33267bea (16)
- M src/test/scala/net/ceedubs/ficus/ExampleSpec.scala https://github.com/iheartradio/ficus/pull/158/files#diff-df27509f99618ed8a331b70ae6517f4fd91cf0ede3c71ccbd79bc66102b93ab0 (172)
- M src/test/scala/net/ceedubs/ficus/Examples.scala https://github.com/iheartradio/ficus/pull/158/files#diff-b2ca99b95dc8ce9612dcd38b06e2d9588d72ea5db1f77c905b118f8f1fa3e4d3 (2)
- M src/test/scala/net/ceedubs/ficus/FicusConfigSpec.scala https://github.com/iheartradio/ficus/pull/158/files#diff-a0c86514e3ed60ddaa3e0dd0aa846c3e087cd401cb2421d63bac69c57561ab03 (136)
- M src/test/scala/net/ceedubs/ficus/readers/AnyValReadersSpec.scala https://github.com/iheartradio/ficus/pull/158/files#diff-200b56c15d49c12273d7e5ec8dd55773a5d0662f508b53386887a9b74788bde8 (14)
- M src/test/scala/net/ceedubs/ficus/readers/ArbitraryTypeReaderSpec.scala https://github.com/iheartradio/ficus/pull/158/files#diff-d8f29d4e21a93df77b16af26a106e3732d2e09c02aa9855c7f3e7882e77ef3b3 (62)
- M src/test/scala/net/ceedubs/ficus/readers/BigNumberReadersSpec.scala https://github.com/iheartradio/ficus/pull/158/files#diff-4699d929d46008dc33ab28ea417f302e1f25376c2668557c4ba9dbed0e6fa5d1 (20)
- M src/test/scala/net/ceedubs/ficus/readers/CaseClassReadersSpec.scala https://github.com/iheartradio/ficus/pull/158/files#diff-4b978b2ccd36360e33af65c333164a4667c47c9ccbbebb6feea5c09b7d444da6 (70)
- M src/test/scala/net/ceedubs/ficus/readers/CollectionReadersSpec.scala https://github.com/iheartradio/ficus/pull/158/files#diff-ff29399b363ce0225bbdd8a2c5f665e8b95e14a8c4bcc1156058082c96fbf7a3 (4)
- M src/test/scala/net/ceedubs/ficus/readers/ConfigReaderSpec.scala https://github.com/iheartradio/ficus/pull/158/files#diff-8fec34ea08d2f166357e31adc506f341fc76e5bcd9adf2d8e57d982642052774 (16)
- M src/test/scala/net/ceedubs/ficus/readers/ConfigValueReaderSpec.scala https://github.com/iheartradio/ficus/pull/158/files#diff-755631af4cb532ecd68486d7bc7a3ead46605b8b467ff69d0d81e0b3f1b4dbc6 (12)
- M src/test/scala/net/ceedubs/ficus/readers/DurationReadersSpec.scala https://github.com/iheartradio/ficus/pull/158/files#diff-f160ed649963357dadfa6f0bdb9acdccfb75f05344eaa13fe9288011e300a6e6 (11)
- M src/test/scala/net/ceedubs/ficus/readers/EitherReadersSpec.scala https://github.com/iheartradio/ficus/pull/158/files#diff-fd6cc2697c0f70658c03642a6f7b223bbeb678d737e7fb0e22c37a69b53df693 (12)
- M src/test/scala/net/ceedubs/ficus/readers/HyphenNameMapperSpec.scala https://github.com/iheartradio/ficus/pull/158/files#diff-414493339eaaeda398949cb8da9ea8564c14b0d04b590c60e1f2f4605c3c0402 (8)
- M src/test/scala/net/ceedubs/ficus/readers/ISOZonedDateTimeReaderSpec.scala https://github.com/iheartradio/ficus/pull/158/files#diff-d14177f9e357f825de9e1978715694e40852141da35587dc5c7e855d85222c14 (9)
- M src/test/scala/net/ceedubs/ficus/readers/LocalDateReaderSpec.scala https://github.com/iheartradio/ficus/pull/158/files#diff-3122be5d1f613de2ca61a68378904758f000f1d16c406f3e5d56883c3a052403 (12)
- M src/test/scala/net/ceedubs/ficus/readers/OptionReadersSpec.scala https://github.com/iheartradio/ficus/pull/158/files#diff-95568ef568a885d0141666298a6a34dc5fdd9ab71acff47631b86025df7ad757 (2)
- M src/test/scala/net/ceedubs/ficus/readers/PeriodReaderSpec.scala https://github.com/iheartradio/ficus/pull/158/files#diff-ad728ede39bfd369d6ab543b0aa84ef2df1a02fdf94a2aeb41210313f932baa2 (23)
- M src/test/scala/net/ceedubs/ficus/readers/StringReaderSpec.scala https://github.com/iheartradio/ficus/pull/158/files#diff-4a0d05e169da4a7a807df6dfde07a6c01125508781eb8102b73accb1df87a4ff (2)
- M src/test/scala/net/ceedubs/ficus/readers/SymbolReaderSpec.scala https://github.com/iheartradio/ficus/pull/158/files#diff-05bc0f20917fe1240fda4c717c598a85c6a13a40acd0e61975b66d1eb17a32ce (2)
- M src/test/scala/net/ceedubs/ficus/readers/TryReaderSpec.scala https://github.com/iheartradio/ficus/pull/158/files#diff-6221674cda2dea83d967664823b9d81b8bb88ee635179df06fe1bc3d4d49afa7 (4)
- M src/test/scala/net/ceedubs/ficus/readers/URLReaderSpec.scala https://github.com/iheartradio/ficus/pull/158/files#diff-9b35bc68ecc331f1d5b042e4d76adad986cd777be5e6542d33a08eb840aca9b4 (6)
- M src/test/scala/net/ceedubs/ficus/readers/ValueReaderSpec.scala https://github.com/iheartradio/ficus/pull/158/files#diff-95bc7bf642eacf8567bb769f16ddc0379cdd61657fe4377777cb985219517f8e (2)
Patch Links:
- https://github.com/iheartradio/ficus/pull/158.patch
- https://github.com/iheartradio/ficus/pull/158.diff
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/iheartradio/ficus/pull/158, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAUKOLRZE5QQJYN52BFTXDT4WJEJANCNFSM5CELKK5A .
To be completely honest I don't even use this. It's a dependency of a test dependency of a dependency that I can do without, this is just for fun really. I was pretty hesitant even to open the WIP for that reason but I'd put a few hours in and thought I'd gauge if there was any interest, in which case I might pursue this, if only as an excuse to fiddle with scala 3 macros a bit more. I won't be salty if this pr is closed with a 'won't fix' or whatever - not least because I'm aware how glaringly incomplete it is as a PR and because as it stands it would change the API
I think a more worthwhile endeavor might be PR to help your test dependency to migrate away from ficus. I have a gut feeling that it will take less effort. Ficus depends on scala-reflect which is not supported by scala 3
On Sun, Aug 15, 2021, 3:55 PM hughsimpson @.***> wrote:
To be completely honest I don't even use this. It's a dependency of a test dependency of a dependency, this is just for fun really
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/iheartradio/ficus/pull/158#issuecomment-899101897, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAUKOKAPWTGV5YZZJ4JFEDT5ALURANCNFSM5CELKK5A .
The innocuous bits:
Lots of things still to figure out:
.as[Foo]("configObjectName")
directly without casting first. This might be a dotty bug, I haven't minimised it yet Edit: this turns out to actually be a conflict with this test lib: whereas
is defined in a trait it's overriding the import, so we're seeing errors from the wrong method. Natural solution for now is probably to change the tests rsther than the API... (CF https://github.com/lampepfl/dotty/issues/13300)to
as a result. I doubt it really helped Edit: it definitely did help, but since it's a conflict with implicits from tests only should be reverted (see above)Would probably be sensible to take the scalafmt change and the syntactic restrictions as a single pr, and figure out how to make the macros work incrementally. I think I might forget about this, 'cause it's not even a direct dependency of mine, but thought it was only fair to show my working nonetheless. If there's any interest in this work I'm happy to split this pr up into mergeable and work-in-progress