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 processing to support customizable modes #21

Merged
merged 9 commits into from
Jan 6, 2025

Conversation

coordt
Copy link
Member

@coordt coordt commented Jan 5, 2025

Enhanced handling by introducing ProcessMode and TemplateFile for fine-grained control over rendering and writing. Updated functions like catalog_s and catalog_inheritance to utilize these new constructs. Adjusted tests and core logic to align with the updated processing flow.


Changes Made:

  • Introduced ProcessMode and TemplateFile for more control.
  • Updated functions catalog_s and catalog_inheritance.
  • Adjusted tests and core logic for compatibility.

coordt added 8 commits January 5, 2025 09:35
Replaced mock UI with `return_defaults` and updated tests accordingly. Enhanced the `process_overlay` return logic to re-merge the pattern context, ensuring extra context requiring answers is properly rendered. Simplified and clarified related test cases.
Previously, the `skip_when` attribute for `Choice` was mandatory, causing issues when unset. This update ensures that `skip_when` defaults to `False` if not provided, improving robustness. Additionally, a new test case was added to cover this scenario with an extra choice.
Renamed `tui.py` to `ui/terminal.py` and introduced a new `ui/defaults.py` for handling default UI behavior. Updated tests to reflect these changes, including restructuring test files and replacing `tui` references with `ui.terminal` or `ui.defaults` as appropriate. This organizes the UI logic and testing structure for better clarity and maintainability.
Replaced `use_default_ui` function with `return_defaults` for simplification and unified default handling. Adjusted imports to reflect module restructuring. Improves code maintainability and aligns with updated project structure.
Enhanced template handling by introducing `ProcessMode` and `TemplateFile` for fine-grained control over rendering and writing. Updated functions like `catalog_templates` and `catalog_inheritance` to utilize these new constructs. Adjusted tests and core logic to align with the updated template processing flow.
Introduces `rel_fnmatch` to enforce relative pattern matching and `matches_any_glob` to check paths against multiple glob patterns. These functions enhance flexibility and simplify matching logic for file and path operations.
Updated the build process to handle template paths with associated processing modes. This change lays the groundwork for incorporating `skip` and `copy_only` attributes in a future update, as noted in TODO[#20].
Copy link

github-actions bot commented Jan 5, 2025

Version hint: minor
Current version: 0.3.0
New version (when merged): 0.4.0

Comment ID: Display the version hint-auto-generated

Copy link

github-actions bot commented Jan 5, 2025

PR Preview Action v1.4.8
🚀 Deployed preview to https://callowayproject.github.io/project-forge/pr-preview/pr-21/
on branch gh-pages at 2025-01-06 12:24 UTC

Added functionality to process skip and copy_only file patterns during template rendering. Updated corresponding tests and logic in multiple modules to ensure correct skipping, copying, and rendering behavior. Improved code clarity and removed outdated TODO comments.

Fixes #20
@coordt coordt merged commit 3636c94 into master Jan 6, 2025
8 checks passed
@coordt coordt deleted the 20-skip-and-copy_only-template-attributes branch January 6, 2025 12:26
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.

Need to incorporate skip, and copy_only attributes to the templates for rendering
1 participant