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

suggest: read trove.yml in the current directory (or load with option) #115

Closed
kyoto7250 opened this issue Apr 25, 2022 · 6 comments · Fixed by #121
Closed

suggest: read trove.yml in the current directory (or load with option) #115

kyoto7250 opened this issue Apr 25, 2022 · 6 comments · Fixed by #121
Assignees
Labels
✨ enhancement New feature or request

Comments

@kyoto7250
Copy link
Contributor

Many projects use Makefile, gradle, and npm and more to configure commands for their project, but we often need to read the code inside because those tools are difficult to write a detailed description.

If hoard have the ability to read trove.yml in the current directory, we will be able to search for those commands and give them descriptions.

This makes it possible to add trove.yml to each repository to manage commands.

# project root
Makefile # declare command
trove.yml # search, and execute in Makefile command.

Whether to load automatically or optionally needs to be discussed.

@kyoto7250 kyoto7250 changed the title suggest: read trove.yml in the current directory (or Load with option) suggest: read trove.yml in the current directory (or load with option) Apr 25, 2022
@Hyde46
Copy link
Owner

Hyde46 commented Apr 25, 2022

I like this approach!
When running hoard list it could scan the current working directory for such a trove file and merge it with the 'global' trove file.

As for customizability, I think it could make sense to per default only show the contents of the local trove file, and ad a shortcut to enable showing the merged trove files.
Additionally, the default value of which one should be shown on running hoard list or the shortcut to start hoard could be set in the config

@Hyde46 Hyde46 added the ✨ enhancement New feature or request label Apr 25, 2022
@Hyde46
Copy link
Owner

Hyde46 commented Apr 25, 2022

Are you interested in working on this @kyoto7250 ?
There's a couple of methods already present for the merging logic of trove files.

@kyoto7250
Copy link
Contributor Author

kyoto7250 commented Apr 26, 2022

@Hyde46
OK, could you assign this issue to me?

@kyoto7250
Copy link
Contributor Author

kyoto7250 commented Apr 26, 2022

As I understand it now.

  • trove.yml in the current directory are automatically read
  • Merged commands can be displayed by pressing a key in the TUI.
  • And, there is a setting in config.yml to display merged commands from the beginning.

@Hyde46
Copy link
Owner

Hyde46 commented Apr 26, 2022

After having thought about it a bit more, adding the merge functionality with conditional visualization of either the local trove, global trove or the merge needs a little more work on the data model. Since there's no way to distinguish the two after merging.

So for now we can split this up and make this PR only touch on the loading of local troves.
As I see it, you could add a new function somewhere around this block which checks if a trove file is present in the current working directory. If there is a local trove file present, only run commands_gui::run() with the local trove file that was found here.

Additionally, a config field which can turn off this functionality would be nice

@Hyde46
Copy link
Owner

Hyde46 commented Apr 26, 2022

If you want more detail on any of these steps, please dont hestitate to ask, and I will provide it 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants