Skip to content

Conversation

@DK96-OS
Copy link
Owner

@DK96-OS DK96-OS commented Jul 13, 2025

Important Changes

Some Defaults have been changed, most notably:

  1. Build operations now include Overwrite Protection.
  2. Trim operations now Copy files, instead of Move.

New CLI Arguments

Overwrite Protections

  • Try to prevent writing to non-empty files by default.
  • If Data file is empty, prevent overwriting Tree file, unless --exact provided.

Add --overwrite, and include --exact to enable zeroing files with the Build operation.

Move Files

  • Copy is the default for both Build and Trim.
  • Previously, trim would move by default.

Add -m or --move_files to your TreeScript command.

Text Merge

  • Works with Build and Trim.
  • Combine Text files in a Tree, or in a DataDirectory.

Add --append or --prepend to select the TextMerge operation.

DK96-OS and others added 3 commits July 13, 2025 06:44
* Update setup.py - version 0.2
* Update test_argument_parser - add test cases, implement new ArgumentData fields (append and prepend)
* Update __init__ - implement append and prepend options translation from ArgumentData to InputData
* Update argument_data - add overwrite option, add prepend option, include note in docs about how Append is the default mode
* Update argument_parser - add overwrite option, add prepend option, add option combination validation
* Update input_data - add field append, add field prepend
@DK96-OS DK96-OS added the enhancement New feature or request label Jul 13, 2025
@DK96-OS DK96-OS self-assigned this Jul 13, 2025
@DK96-OS
Copy link
Owner Author

DK96-OS commented Jul 13, 2025

Should the default be changed?
Or should it stay overwrite, and append will be the optional argument?

DK96-OS and others added 3 commits July 15, 2025 04:33
* Create file_mode_enum
* Update input_data - implement FileModeEnum instead of append and prepend fields
* Update __init__ - update InputData with FileModeEnum, add hidden method _determine_file_mode_from_arg_data
@DK96-OS
Copy link
Owner Author

DK96-OS commented Jul 15, 2025

The new features haven't been implemented.
The decision on whether to change the default overwrite can be delayed until then.

DK96-OS added 20 commits July 18, 2025 17:30
* Create test_path_operations
* Rename test_init_build_tree to test_method_build_tree
* Rename test_init_process_results to test_method_process_results
* Create path_operations
* Update tree_trimmer - implement FileModeEnum, add hidden method _get_builder_method
* Update tree_builder - implement FileModeEnum, add hidden method _get_trimmer_method, remove hidden method _create_file, add a hidden method for each file mode
* Update __init__ - implement InputData mode field
* Update path_operations - update docs, revise unreleased method argument name
* Update build_validation - update code style
* Update trim_validation - update code style
* Update tree_builder - update docs, debug none data_path, set default FileModeEnum to overwrite at the method level
* Update tree_trimmer - update docs
* Update conftest - add data providers
* Update path_operations - debug exception handling
* Update tree_builder - add hidden method _build_instruction, remove hidden method _make_dir_exist
* Update test_tree_builder - update docs, add test cases
* Update tree_builder - fix lint
* Update test_tree_trimmer - update test cases
* Update tree_builder - update docs
* Update path_operations - update docs
* Update file_mode_enum - add CANCEL
* Update path_operations - add method extract_file
* Update tree_trimmer - remove outdated hidden methods, add hidden method _trim_instruction, update file mode method selection
* Update test/treescript_builder/tree/conftest.py - add data provider generator methods for InstructionData matching similar existing TreeData generators (InstructionData generator sequences obtained from existing test modules)
* Remove test_method_process_results
* Update test_build_validation - implement data provider generator methods for expected InstructionData
* Update file_mode_enum - add MOVE option
* Create test_data_provider_method_create_depth
* Update test_argument_parser - use module field for common string, add test cases, replace ArgumentData parametrization with more specific subsets of inputs
* Remove test_init - split into test_method_ modules
* Update test_string_validation - add test cases, improve test case formatting
* Create test_method_validate_input_arguments
* Update __init__ - implement all FileModeEnum options
* Update argument_data - update docs, add a field for all FileModeEnum options accessible through CLI options, add field verbosity
* Update argument_parser - improve argument validation with more type checking, implement mutually exclusive options for FileMode Enum selection, validate verbosity argument, add parser arguments for all FileModeEnum options (except the default), add parser argument counter for verbosity
* Update file_validation - implement filename and data_dir argument normalization, update docs, add hidden method _normalize_pathname
* Update input_data - add field verbosity_level
* Update line_reader - update docs, fix lint
* Update string_validation - update docs, modify method validate_name to only accept strings that contain only ascii characters
* Update test_argument_parser - debug pytest.raises and use match argument with re.escape
* Update trim_validation - add move_files parameter, modify output instructions so that copy operations do not include directories
* Update data_directory - add method validate_build_unique (to prevent duplicate DataLabels in move operations), modify method get_data_dir_validator (add parameter move_files and use validate_build_unique method when true)
* Update build_validation - add move_files parameter
* Update conftest - expand data provider method get_data_tree_instructions with is_trim parameter, add string data provider for data_tree + add data_tree to treescript input_samples
* Update conftest - debug data_tree instruction_data field
* Update conftest - remove unused fixtures, debug fixture temp_cwd, remove unused data provider get_data_tree_instructions
* Create test_file_operations
* Create test_method_tree_operations
* Update test_path_operations - parametrize similar test cases, add test cases, debug test case setup (mock_data_tree failed to provide test conditions)
* Update test_method_validate_tree - add move_files parameter (modify test cases to no longer expect directory instructions for copy operations)
* Update file_validation - add method safe_read_text_file
* Update __init__ - modify package method tree_operations to import tree package method validate_tree
* Update file_operations - split trim and build into distinct hidden methods, modify instruction handling (only DataLabel instructions processed by build/trim method)
* Update __main__ - remove step between input_data and tree_operations
* Update test_file_operations - update hidden method test cases
* Update path_operations - remove NoneType from second Path argument in Callable type, remove target_file touch operations when source_file is None
* Update __init__ - debug missing input_data field
* Update file_operations - adjust trim and move_files instruction handling
* Update results - simplify error message handling
* Update test_results - update expected results messages in test cases, add test case for move_files
* Update test_method_tree_operations - update expected results messages in test cases, optimize imports
* Update test_file_operations - debug test case (move_file trim operations still operate on directories)
* Update test_main - optimize imports, debug PrintCollector, update test cases, debug test cases (create parent dirs when using mkdir), adjust test cases for recognized options
* Update ci_run - upload test coverage reports always
* Update test_file_operations - debug incorrect mock method
* Update control_modes - remove unused imports
* Update test_file_operations - debug test case
* Update test_data_directory - add test cases for validate_build_unique
* Update test_file_operations - add test case
* Update test_results - add test cases
* Update file_operations - simplify error message
* Update results - remove unnecessary branch
* Update test_method_validate_input_arguments - fix lint
* Update test_argument_parser - fix lint
* Update test_input_data - fix lint
* Update file_operations - simplify method structures, implement exact overwrite requirement for deleting files with trim, update Path Operation Method definition in docs
* Update results - simplify hidden method by removing unused parameters
* Update file_validation - add parameter file_size_limit to method safe_read_text_file, add method check_not_symlink, add method check_text_file_stats, simplify method validate_input_file by implementing new check-prefixed methods internally
* Update string_validation - simplify hidden method internal logic
* Update __init__ - add move_files parameter to validate_build method
@DK96-OS
Copy link
Owner Author

DK96-OS commented Nov 5, 2025

A1 Tests done on 67b204.

* Update data_directory - add method validate_trim_merge, add method validate_trim_overwrite, add hidden method unique_label for handling uniqueness checks across validation methods
* Update path_operations - review and implement file_validation improvements
* Update results - simplify Pass/Fail messages, implement os-defined path_separator in file_paths
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant