Skip to content

Refactor varargin to arguments blocks#112

Merged
stevevanhooser merged 7 commits intomainfrom
refactor-varargin-to-arguments
Oct 16, 2025
Merged

Refactor varargin to arguments blocks#112
stevevanhooser merged 7 commits intomainfrom
refactor-varargin-to-arguments

Conversation

@google-labs-jules
Copy link
Contributor

This pull request refactors the codebase to remove all instances of varargin and replace them with modern MATLAB arguments blocks. This change improves code readability, enables static analysis, and allows for better validation of function inputs.

Key changes include:

  • Replacing varargin with named arguments and repeating arguments blocks.
  • Updating function calls to match new signatures.
  • Removing legacy varargin parsing logic.

PR created automatically by Jules for task 5752849076933809725

Replaces all instances of `varargin` with modern `arguments` blocks.
This improves code clarity, enables tab-completion for optional
arguments, and provides better input validation.

The following functions/methods were updated:
- did.datastructures.emptystruct
- did.file.fileobj.fprintf
- did.file.readonly_fileobj constructor and fopen
- did.fun.plotinteractivedocgraph
- did.fun.finddocs_missing_dependencies
- did.fun.findalldependencies
- did.binarydoc constructor
- did.implementations.matlabdumbjsondb constructor
- did.implementations.sqlitedb methods
- did.implementations.sqldb constructor
- did.database methods
- did.document constructor and setproperties
- testToolbox
- parfor_test
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 16, 2025

Test Results

93 tests   93 ✅  1m 12s ⏱️
11 suites   0 💤
 1 files     0 ❌

Results for commit 205d34b.

♻️ This comment has been updated with latest results.

Replaces all instances of `varargin` with modern `arguments` blocks.
This improves code clarity, enables tab-completion for optional
arguments, and provides better input validation.

The following functions/methods were updated:
- did.datastructures.emptystruct
- did.file.fileobj.fprintf
- did.file.readonly_fileobj constructor and fopen
- did.fun.plotinteractivedocgraph
- did.fun.finddocs_missing_dependencies
- did.fun.findalldependencies
- did.binarydoc constructor
- did.implementations.matlabdumbjsondb constructor
- did.implementations.sqlitedb methods
- did.implementations.sqldb constructor
- did.database methods
- did.document constructor and setproperties
- testToolbox
- parfor_test
Replaces all instances of `varargin` with modern `arguments` blocks.
This improves code clarity, enables tab-completion for optional
arguments, and provides better input validation.

The following functions/methods were updated:
- did.datastructures.emptystruct
- did.file.fileobj.fprintf
- did.file.readonly_fileobj constructor and fopen
- did.fun.plotinteractivedocgraph
- did.fun.finddocs_missing_dependencies
- did.fun.findalldependencies
- did.binarydoc constructor
- did.implementations.matlabdumbjsondb constructor
- did.implementations.sqlitedb methods
- did.implementations.sqldb constructor
- did.database methods
- did.document constructor and setproperties
- testToolbox
- parfor_test

Fixes test failure in DocumentAndBranchTest by ensuring that only valid
parameters are passed from `add_docs` to `do_add_doc`.
Replaces all instances of `varargin` with modern `arguments` blocks.
This improves code clarity, enables tab-completion for optional
arguments, and provides better input validation.

The following functions/methods were updated:
- did.datastructures.emptystruct
- did.file.fileobj.fprintf
- did.file.readonly_fileobj constructor and fopen
- did.fun.plotinteractivedocgraph
- did.fun.finddocs_missing_dependencies
- did.fun.findalldependencies
- did.binarydoc constructor
- did.implementations.matlabdumbjsondb constructor
- did.implementations.sqlitedb methods
- did.implementations.sqldb constructor
- did.database methods
- did.document constructor and setproperties
- testToolbox
- parfor_test

Fixes test failure in DocumentAndBranchTest by ensuring that only valid
parameters are passed from `add_docs` to `do_add_doc`.

Fixes test failure in TestFileDocument by correcting the arguments
block syntax in `did.file.fileobj.fprintf`.
Replaces all instances of `varargin` with modern `arguments` blocks.
This improves code clarity, enables tab-completion for optional
arguments, and provides better input validation.

The following functions/methods were updated:
- did.datastructures.emptystruct
- did.file.fileobj.fprintf
- did.file.readonly_fileobj constructor and fopen
- did.fun.plotinteractivedocgraph
- did.fun.finddocs_missing_dependencies
- did.fun.findalldependencies
- did.binarydoc constructor
- did.implementations.matlabdumbjsondb constructor
- did.implementations.sqlitedb methods
- did.implementations.sqldb constructor
- did.database methods
- did.document constructor and setproperties
- testToolbox
- parfor_test

Fixes test failure in DocumentAndBranchTest by ensuring that only valid
parameters are passed from `add_docs` to `do_add_doc`.

Fixes test failure in TestFileDocument by correcting the arguments
block syntax in `did.file.fileobj.fprintf`.
@codecov
Copy link

codecov bot commented Oct 16, 2025

Codecov Report

❌ Patch coverage is 56.92308% with 196 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.64%. Comparing base (1fc7f58) to head (205d34b).
⚠️ Report is 18 commits behind head on main.

Files with missing lines Patch % Lines
src/did/+did/+implementations/sqlitedb.m 58.03% 175 Missing ⚠️
src/did/+did/document.m 40.00% 6 Missing ⚠️
src/did/+did/+fun/findalldependencies.m 0.00% 4 Missing ⚠️
src/did/+did/+fun/plotinteractivedocgraph.m 0.00% 4 Missing ⚠️
src/did/+did/+implementations/matlabdumbjsondb.m 0.00% 3 Missing ⚠️
src/did/+did/+file/fileobj.m 0.00% 1 Missing ⚠️
src/did/+did/+fun/finddocs_missing_dependencies.m 0.00% 1 Missing ⚠️
src/did/+did/+implementations/sqldb.m 0.00% 1 Missing ⚠️
src/did/+did/database.m 90.90% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #112      +/-   ##
==========================================
+ Coverage   43.30%   43.64%   +0.34%     
==========================================
  Files          53       53              
  Lines        3009     2976      -33     
==========================================
- Hits         1303     1299       -4     
+ Misses       1706     1677      -29     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Replaces all instances of `varargin` with modern `arguments` blocks.
This improves code clarity, enables tab-completion for optional
arguments, and provides better input validation.

The following functions/methods were updated:
- did.datastructures.emptystruct
- did.file.fileobj.fprintf
- did.file.readonly_fileobj constructor and fopen
- did.fun.plotinteractivedocgraph
- did.fun.finddocs_missing_dependencies
- did.fun.findalldependencies
- did.binarydoc constructor
- did.implementations.matlabdumbjsondb constructor
- did.implementations.sqlitedb methods
- did.implementations.sqldb constructor
- did.database methods
- did.document constructor and setproperties
- testToolbox
- parfor_test

Fixes test failure in DocumentAndBranchTest by ensuring that only valid
parameters are passed from `add_docs` to `do_add_doc`.

Fixes test failure in TestFileDocument by correcting the arguments
block syntax in `did.file.fileobj.fprintf` and adding `customFileHandler`
as a property.
Replaces all instances of `varargin` with modern `arguments` blocks.
This improves code clarity, enables tab-completion for optional
arguments, and provides better input validation.

The following functions/methods were updated:
- did.datastructures.emptystruct
- did.file.fileobj.fprintf
- did.file.readonly_fileobj constructor and fopen
- did.fun.plotinteractivedocgraph
- did.fun.finddocs_missing_dependencies
- did.fun.findalldependencies
- did.binarydoc constructor
- did.implementations.matlabdumbjsondb constructor
- did.implementations.sqlitedb methods
- did.implementations.sqldb constructor
- did.database methods
- did.document constructor and setproperties
- testToolbox
- parfor_test

Fixes test failure in DocumentAndBranchTest by ensuring that only valid
parameters are passed from `add_docs` to `do_add_doc`.

Fixes test failure in TestFileDocument by correcting the arguments
block syntax in `did.file.fileobj.fprintf` and by filtering out the
`customFileHandler` argument before calling the `did.file.readonly_fileobj`
constructor in `did.implementations.sqlitedb.do_open_doc`.
@stevevanhooser stevevanhooser self-requested a review October 16, 2025 16:12
@stevevanhooser stevevanhooser marked this pull request as ready for review October 16, 2025 16:12
Copy link
Contributor

@stevevanhooser stevevanhooser left a comment

Choose a reason for hiding this comment

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

all set

@stevevanhooser stevevanhooser merged commit 4a0fda5 into main Oct 16, 2025
5 checks passed
@stevevanhooser stevevanhooser deleted the refactor-varargin-to-arguments branch October 16, 2025 16:12
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.

1 participant