-
Notifications
You must be signed in to change notification settings - Fork 843
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 commands for automating stack.yaml management #115
Comments
Jotting down ideas: Possibly can implement this like
( For a generic interface. These are particularly handy for easy scripting or IDE use. |
personally I would probably just edit the YAML file for some of these, particularly if there is good feedback about incorrect configurations of the YAML file. |
Part of the motivation here is to keep the config machine-readable and machine-writable, especially as it'll probably expand in scope. Automatic edits to cabal files is a PITA for IDEs (and Emacs) to do because user-edits were prioritized over machine edits. Comparatively, tooling for Git is easy because the information is always easy to read and edit by tools. Hence, I propose we take the Git approach in which commandline edit (or read) or manual edit is possible. But yeah, there should also be decent error messages from the YAML parser, agreed. |
(That and it's nice to give newbies a line like |
makes sense that it is much easier for tooling. Otherwise tooling would need to depend on a yaml lib and the YAML format would be an interface that is more difficult to change. |
+1 for easy way to upgrade snapshot (and probably extra-deps at the same time). Looks like the current way to do it is
Lots of hairballs there. |
+1, I find myself doing naively the same as @chreekat for now |
Following #390: running |
Would Because if the latter, it makes it simple to move a given dev environment as a whole onto a different snapshot/nightly. |
I think it would do both: |
👍 I just found myself in the situation of needing some form of |
|
Something that may be relevant to this discussion - augeas is a nice tool to manipulate config files in a generic way. One can write a augeas lens for stack.yaml to be able to manipulate it via augtool. This can be handy to manipulate stack.yaml through scripts. I could find one example of a YAML lens on my debian jessie linux installation - If we ship the lens with augeas then it will provide anyone the ability to manipulate stack configs via standard configuration management tools which support augeas. Not sure if that use case is useful for stack though. |
The discussion in #1365 is related to this. Some |
One advantage of augeas would be that according to its FAQ:
Augeas even has Haskell bindings although these have not been updated since 2012. It seems though that augeas is Unix-only, so any use of augeas, whether via the bindings on by providing lenses for use with augtool, would exclude Windows users. |
It does seem that an augeas port to windows may be within reach. This branch is a bit behind, but sounds promising: https://tickets.puppetlabs.com/browse/PUP-4971 https://github.com/MikaelSmith/augeas/tree/windows I haven't worked with augeas, but I am certainly in favor of such re-use when it's possible and it works well. On the other hand, refactoring yaml is an interesting problem to me, that I wouldn't mind having a swing at it (readers, feel free to leave a comment here and have a swing at it yourself! Not sure when this implementation will actually happen). |
I think we've implemented as much of this as desired for now. New requests can go into new issues. |
Originally discussed in #27. Exact requirements here are uncertain, some ideas:
The text was updated successfully, but these errors were encountered: