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

taplo-cli: add ENV variable support #427

Merged
merged 3 commits into from
Jul 16, 2023
Merged

taplo-cli: add ENV variable support #427

merged 3 commits into from
Jul 16, 2023

Conversation

razvanazamfirei
Copy link
Contributor

This pull request improves the configuration file lookup logic in taplo-cli. The changes enable the CLI to search for a configuration file in the TAPLO_CONFIG environment variable if no configuration file is found in the current working directory and no explicit path has been provided by the user.

Changes:

  1. Added support for TAPLO_CONFIG in the load_config function.
  2. Minor documentation updates

Copy link
Collaborator

@ia0 ia0 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, that's a good idea!

crates/taplo-cli/src/args.rs Outdated Show resolved Hide resolved
crates/taplo-cli/src/lib.rs Outdated Show resolved Hide resolved
site/site/cli/usage/configuration.md Outdated Show resolved Hide resolved
@razvanazamfirei
Copy link
Contributor Author

Thanks, @ia0! Changes made.

Copy link
Collaborator

@ia0 ia0 left a comment

Choose a reason for hiding this comment

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

Thanks!

You also need to add the env feature to clap.

-clap = { version = "3.0.0", features = ["derive", "cargo"] }
+clap = { version = "3.0.0", features = ["derive", "cargo", "env"] }

crates/taplo-cli/src/args.rs Outdated Show resolved Hide resolved
@razvanazamfirei razvanazamfirei requested a review from ia0 July 16, 2023 13:01
Copy link
Collaborator

@ia0 ia0 left a comment

Choose a reason for hiding this comment

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

Thanks!

@ia0 ia0 requested a review from panekj July 16, 2023 13:10
@panekj panekj merged commit 55c393e into tamasfe:master Jul 16, 2023
@razvanazamfirei razvanazamfirei deleted the env-variable-support branch July 16, 2023 15:07
@paholg paholg mentioned this pull request Mar 5, 2024
13 tasks
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.

3 participants