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

♻️ Refactor needs post-processing function signatures #1040

Merged
merged 1 commit into from
Sep 29, 2023

Conversation

chrisjsewell
Copy link
Member

@chrisjsewell chrisjsewell commented Sep 28, 2023

This PR refactors the functions that post-process needs data, to only get passed what they actually require (rather than just app or env).
This makes it clearer what they are doing, and in all cases except resolve_dynamic_values effectively de-couples the post-processing from Sphinx, since you just need to pass them the needs data and needs configuration.

@chrisjsewell chrisjsewell changed the title ♻️ Refactor needs processing function signatures ♻️ Refactor needs post-processing function signatures Sep 28, 2023
Comment on lines +386 to +391
resolve_dynamic_values(needs, app)
resolve_variants_options(needs, needs_config, app.builder.tags.tags)
check_links(needs, needs_config)
create_back_links(needs, needs_config)
process_constraints(needs, needs_config)
extend_needs_data(needs, needs_data.get_or_create_extends(), needs_config)
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the key change

@chrisjsewell chrisjsewell merged commit f1769b6 into master Sep 29, 2023
10 checks passed
@chrisjsewell chrisjsewell deleted the refactor-post-processing-function-sigs branch September 29, 2023 11:45
iSOLveIT pushed a commit that referenced this pull request Oct 24, 2023
This commit refactors the functions that post-process needs data, to only get passed what they actually require (rather than just `app` or `env`).
This makes it clearer what they are doing, and in all cases except `resolve_dynamic_values` effectively de-couples the post-processing from Sphinx, since you just need to pass them the needs data and needs configuration.
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.

2 participants