Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add project_configuration_tool option to template #21

Merged
merged 5 commits into from
Oct 6, 2021

Conversation

chiroptical
Copy link
Collaborator

@chiroptical chiroptical commented Sep 28, 2021

Closes #20

  • Add an option project_configuration_tool which writes package.yaml instead of your-project-name.cabal
  • Added an additional CI step which overrides the default project_configuration_tool to hpack to test all configuration options
  • I used stack new example-project to approximate a minimal package.yaml file with the changes you made in the cabal template

Comment on lines 5 to 6
'{% if cookiecutter.use_hpack == "y" %} {{ cookiecutter.project_name }}.cabal {% endif %}',
'{% if cookiecutter.use_hpack != "y" %} package.yaml {% endif %}',
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsure if I should do case insensitive match here

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that would be better. I think, more importantly, it isn't ideal in the sense that it's not obvious which strings are allowed, and one can enter nonsense which will still pass. Maybe something like Choice Variables functionality might work better there, eg. it could be something like:

Select package description format:
1 - Cabal
2 - HPack
Choose from [1], 2:

What do you think? It's a bit more wordy, but at least it is obvious that it's a choice between two.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree because the default is more obvious. I am just hoping I can make {{project_name}}.cabal or package.yaml (hpack) or something

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handled in e125757

@@ -26,6 +26,7 @@ let
pkgs.haskellPackages.ghcid
pkgs.haskellPackages.ormolu
pkgs.haskellPackages.hlint
{% if cookiecutter.use_hpack == "y" %}pkgs.haskellPackages.hpack{% endif %}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The nix build will pick this up automatically, but it would be nice to have in the shell for local dev

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, it is definitely good to have. But even after this one needs to remember running hpack every time after package.yaml. So it would be great if we can also mention this on the README.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handled in 1aeab4d

@utdemir
Copy link
Owner

utdemir commented Sep 29, 2021

Thanks for the PR! I just wanted to tell you that I am a bit busy this week, so I will review this over the weekend; but I will definitely get to this!

Copy link
Owner

@utdemir utdemir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, I have a few comments, but otherwise happy to merge!

@@ -26,6 +26,7 @@ let
pkgs.haskellPackages.ghcid
pkgs.haskellPackages.ormolu
pkgs.haskellPackages.hlint
{% if cookiecutter.use_hpack == "y" %}pkgs.haskellPackages.hpack{% endif %}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, it is definitely good to have. But even after this one needs to remember running hpack every time after package.yaml. So it would be great if we can also mention this on the README.

@chiroptical
Copy link
Collaborator Author

@utdemir I believe I addressed all the issues you pointed out. Thanks for the great input! Also, if you have any other features in mind feel free to bother me about them. I plan to use this template for the foreseeable future and would be happy to dev on it.

@chiroptical chiroptical changed the title Add use_hpack option to template Add project_configuration_tool option to template Oct 3, 2021
@chiroptical chiroptical requested a review from utdemir October 5, 2021 13:25
@utdemir
Copy link
Owner

utdemir commented Oct 6, 2021

Thank you for the changes :). And I apologize for the late reply, I was a bit busy at work.

Also, if you have any other features in mind feel free to bother me about them. I plan to use this template for the foreseeable future and would be happy to dev on it.

Well, one feature I'd really appreciate to have would be #19 , #18 , and similarly supporting benchmarks. I was also thinking about migrating to use tasty-discover alongside with tasty-hunit and tasty-hedgehog. If any of them is interesting to you, feel free to work on it!

I am also happy to make you a maintainer if you are planning to contribute, just let me know if you are keen.

Thanks again!

@utdemir utdemir merged commit 33a1991 into utdemir:master Oct 6, 2021
@chiroptical chiroptical deleted the useHpack branch October 6, 2021 13:28
@chiroptical
Copy link
Collaborator Author

I am also happy to make you a maintainer if you are planning to contribute, just let me know if you are keen.

I don't mind at all! I'll likely pick up some of these issues soon. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding hpack?
2 participants