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

Read user defined configuration file from $ROOT/.topiary/languages.toml #506

Merged
merged 8 commits into from
Jun 15, 2023

Conversation

ErinvanderVeen
Copy link
Collaborator

@ErinvanderVeen ErinvanderVeen commented Jun 13, 2023

Resolves #505

This would allow users to define custom options.

This PR splits parsing of the configuration file into 2 parts. The first is parsing to toml::Value, this makes it easier to merge the values of multiple configuration files. From there it is try_into to our Configuration.

The default_configuration (2 functions) have been made part of the topiary crate itself. Other functions, like the one that reads from .topiary/languages.toml is part of the topiary-cli crate, which gets a new configuration module.

Remaining tasks:

  • Find a way to find $ROOT, probably by looking up in the directories until we find .topiary
  • Also parse $XDG_CONFIG/.topiary/languages.toml

@ErinvanderVeen ErinvanderVeen linked an issue Jun 13, 2023 that may be closed by this pull request
Erin van der Veen added 2 commits June 14, 2023 09:26
@ErinvanderVeen ErinvanderVeen force-pushed the 505-user-configuration-file branch 4 times, most recently from c6543ee to 8b46b80 Compare June 14, 2023 13:23
@ErinvanderVeen ErinvanderVeen marked this pull request as ready for review June 14, 2023 14:45
topiary/src/error.rs Show resolved Hide resolved
@ErinvanderVeen ErinvanderVeen merged commit e5d2db2 into main Jun 15, 2023
@ErinvanderVeen ErinvanderVeen deleted the 505-user-configuration-file branch June 15, 2023 09:13
@torhovland
Copy link
Member

Shouldn't these new file locations be mentioned in the README.md?

@ErinvanderVeen
Copy link
Collaborator Author

Yes, of course! I'll make a quick follow-up PR.

@ErinvanderVeen ErinvanderVeen restored the 505-user-configuration-file branch June 15, 2023 13:00
@ErinvanderVeen
Copy link
Collaborator Author

#512 followup with documentation

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.

User configuration file
3 participants