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

Use key-value map for extra files #333

Closed
4 tasks done
chshersh opened this issue Jul 26, 2019 · 3 comments · Fixed by #372
Closed
4 tasks done

Use key-value map for extra files #333

chshersh opened this issue Jul 26, 2019 · 3 comments · Fixed by #372
Assignees
Labels
config TOML configurations feature question Ideas, discussions

Comments

@chshersh
Copy link
Contributor

chshersh commented Jul 26, 2019

Currently, we've hardcoded some of the files in the .toml config, for example:

stylish.url = "https://raw.githubusercontent.com/kowainik/org/master/.stylish-haskell.yaml"
contributing.url = "https://raw.githubusercontent.com/kowainik/org/master/CONTRIBUTING.md"

This approach is not extensible because:

  1. It doesn't allow summoner users to bring their own files.
  2. It requires to change Haskell code each time we want to add new files.

Since tomland-1.1 we now have the support for inline tables. And after this issue is implemented we can have only single field in the config of the type Map FilePath Source and in the configuration it will look like this:

extra.files =
    [ { file = ".stylish-haskell.yaml", url = "https://raw.githubusercontent.com/kowainik/org/master/.stylish-haskell.yaml" }
    , { file = "CONTRIBUTING.md", url = "https://raw.githubusercontent.com/kowainik/org/master/CONTRIBUTING.md" }
    ]

What do you think?

The implementation includes:

  • Add Map FilePath Source field to config
  • Create files from the Map
  • Write deprecation messages
  • Pretty tree display in TUI
@chshersh chshersh added question Ideas, discussions feature config TOML configurations labels Jul 26, 2019
@vrom911
Copy link
Member

vrom911 commented Jul 28, 2019

Wow, this is a wonderful idea! I'm fully for this 👍

@chshersh
Copy link
Contributor Author

This also allows to support nix in a simpler way: other people can bring their own additional files if they want and summoner can support only bare minimum.

@chshersh chshersh self-assigned this Nov 3, 2019
@chshersh chshersh added this to the v1.4: Polishment and update milestone Nov 3, 2019
@chshersh chshersh changed the title [RFC] Use key-value map for extra files Use key-value map for extra files Nov 3, 2019
@chshersh
Copy link
Contributor Author

chshersh commented Nov 3, 2019

@vrom911 I will try to do this 👍

chshersh added a commit that referenced this issue Nov 3, 2019
chshersh added a commit that referenced this issue Nov 3, 2019
chshersh added a commit that referenced this issue Nov 3, 2019
This was referenced Nov 4, 2019
chshersh added a commit that referenced this issue Nov 4, 2019
vrom911 pushed a commit that referenced this issue Nov 5, 2019
* [#333] Use key-value map for extra files

Resolves #333

* Fix stack
chshersh added a commit that referenced this issue Nov 5, 2019
* [#333] Use key-value map for extra files

Resolves #333

* Fix stack
vrom911 pushed a commit that referenced this issue Nov 5, 2019
* Create specified extra files (#366)

* Add deprecation messages (#368)

* Update documentation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config TOML configurations feature question Ideas, discussions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants