TheAngryByrd / MiniScaffold

F# Template for creating and publishing libraries targeting .NET 6.0 `net6.0` or console apps .NET 6.0 `net6.0`.
https://www.jimmybyrd.me/MiniScaffold/
MIT License
267 stars 31 forks source link

A few things which confused me as a beginner #266

Closed bash-spbu closed 1 year ago

bash-spbu commented 1 year ago

Hello @TheAngryByrd!

Thank you for your hard and thorough work on this template! I found it extremely useful and helpful to start my professional F# dev path.

I encountered a few issues though during my first try. I do not know which of it you may find noteworthy, so I decided to incorporate it all in one as some kind of feedback:

  1. The very first build did not successed due to test failure:

    You didn't say hello. String does not match at position 44. Expected char: '/', but got '.'.
    expected: Hello Jean-Luc Picard. You were born on 2305/07/13 and your favorite number is 4. You like Red.
      actual: Hello Jean-Luc Picard. You were born on 2305.07.13 and your favorite number is 4. You like Red.

    The problem is that I have another CultureInfo set by default on my system. As a proposed solution I would suggest to call add CultureInfo.InvariantCulture as a second param in person.DateOfBirth.ToString("yyyy/MM/dd", CultureInfo.InvariantCulture) to make the test fully cross-platform.

  2. Tools specified in dotnet-tools.json are pretty outdated, there are a few new major versions, maybe its versions can be updated in the template?
  3. A few files are not formatted according to fantomas spec initially, i.e. right after the template is instantiated I can run dotnet fantomas -r . and a few files will be changed. Though maybe it is like this due to I updated fantomas to the most recent 5.2.2...
  4. I have many warnings during build about net5.0 is out of support for docsTool project. Maybe it can be updated to .net6 as well?
  5. According to another warning it looks like something try to pack docsTool, which as I understand should not be packable due to explicit <IsPackable>false</IsPackable> in its fsproj?

    IsPackableFalseWarningTask: /usr/lib/dotnet/sdk/6.0.113/Sdks/NuGet.Build.Tasks.Pack/build/NuGet.Build.Tasks.Pack.targets(203,6): warning : This project cannot be packaged because packaging has been disabled. Add <IsPackable>true</IsPackable> to the project file to enable producing a package from this project.

    Maybe if you find anything of this worthing attention I could contribute. Best wishes

TheAngryByrd commented 1 year ago

Hello @TheAngryByrd!

Thank you for your hard and thorough work on this template! I found it extremely useful and helpful to start my professional F# dev path.

Thanks for the kind words!

I encountered a few issues though during my first try. I do not know which of it you may find noteworthy, so I decided to incorporate it all in one as some kind of feedback:

  1. The very first build did not successed due to test failure:

    You didn't say hello. String does not match at position 44. Expected char: '/', but got '.'.
    expected: Hello Jean-Luc Picard. You were born on 2305/07/13 and your favorite number is 4. You like Red.
     actual: Hello Jean-Luc Picard. You were born on 2305.07.13 and your favorite number is 4. You like Red.

    The problem is that I have another CultureInfo set by default on my system. As a proposed solution I would suggest to call add CultureInfo.InvariantCulture as a second param in person.DateOfBirth.ToString("yyyy/MM/dd", CultureInfo.InvariantCulture) to make the test fully cross-platform.

Yea this is very much an oversight, be happy to take a PR for this!

  1. Tools specified in dotnet-tools.json are pretty outdated, there are a few new major versions, maybe its versions can be updated in the template?

Happy to take a PR updating these.

The sourcelink seems to be unmaintained and needs to go. (Discussed here)

  1. A few files are not formatted according to fantomas spec initially, i.e. right after the template is instantiated I can run dotnet fantomas -r . and a few files will be changed. Though maybe it is like this due to I updated fantomas to the most recent 5.2.2...

Yeah fantomas changes it's formatting rules constantly so not sure what can be done here. This problem should come through in the integration tests if it wasn't formatted properly with the version that miniscaffold ships with.

  1. I have many warnings during build about net5.0 is out of support for docsTool project. Maybe it can be updated to .net6 as well?

The TFM could be updated, but updating it's dependencies will probably be difficult. I have a plan to replace the docsTool eventually and just use FSharp.Formatting's fsdocs tool but it's a larger migration.

  1. According to another warning it looks like something try to pack docsTool, which as I understand should not be packable due to explicit <IsPackable>false</IsPackable> in its fsproj?
    IsPackableFalseWarningTask: /usr/lib/dotnet/sdk/6.0.113/Sdks/NuGet.Build.Tasks.Pack/build/NuGet.Build.Tasks.Pack.targets(203,6): warning : This project cannot be packaged because packaging has been disabled. Add <IsPackable>true</IsPackable> to the project file to enable producing a package from this project.

Yeah, docsTool shouldn't be packaged and it's marked as such. The warning be triggered by the fact that we do a pack on the solution level. Not sure what can be done here though.