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

Correctly handle include includes #88

Open
wants to merge 5 commits into
base: development
Choose a base branch
from

Conversation

sanjayankur31
Copy link
Contributor

If include_include is True:

  • the contents of the Include line are replaced with the contents of the file
  • else, the Include statement is retained.

We also add tests to check these two scenarios.

Note that when the Include line has been replaced by the file contents, we do not keep the name of the file around. So, we cannot then export a version of the model where the Include lines are present again instead of the file contents. It may be possible to modify the code to allow that by adding arguments to the export_to_dom and export_to_file functions, but we do not currently do this.

- if `include_includes` is set, we replace the `Include` statements with
  their contents
- if not, the `Include` statements are kept as part of the model and
  when the model is exported, they're also exported.

Fixes #86
@sanjayankur31 sanjayankur31 linked an issue Sep 2, 2024 that may be closed by this pull request
@sanjayankur31
Copy link
Contributor Author

the main change is in parse_includes, the rest is linting etc, and tests

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.

Test include_includes
1 participant