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

fix: loader conditionals #23

Merged
merged 1 commit into from
May 25, 2023
Merged

fix: loader conditionals #23

merged 1 commit into from
May 25, 2023

Conversation

maxb2
Copy link
Owner

@maxb2 maxb2 commented May 23, 2023

  • Adds the ability to conditionally execute the underlying loader via typer_config.loaders.loader_transformer. Alternatively, you can define your own loader with a conditional inside.
  • Makes the provided callbacks (typer_config.*_conf_callback) not call the loader by default when the parameter value is empty (fixes --help behavior).
  • Adds tests to make sure --help doesn't crash.

Fixes #24

@codecov
Copy link

codecov bot commented May 23, 2023

Codecov Report

Merging #23 (8b7e6eb) into main (edadf7c) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main       #23   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines           98       102    +4     
=========================================
+ Hits            98       102    +4     
Impacted Files Coverage Δ
typer_config/__init__.py 100.00% <100.00%> (ø)
typer_config/__typing.py 100.00% <100.00%> (ø)
typer_config/loaders.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@maxb2 maxb2 merged commit 4bb82de into main May 25, 2023
@maxb2 maxb2 deleted the fix/conditionals branch May 25, 2023 12:55
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.

Crash when --config not provided
1 participant