Add filter for matlab files
Matlab files (source code ends with .m comment is %) are not covered by reuse yet.
Matlab interprets the first lines of the code and the following comments in a preview function to help the to see what the function is good for.
If we add the license information in the first lines of the comment, the important preview renders unusable.
How should we use SPDX with matlab files, as the first comment lines after function are reserved for short documentation?
https://de.mathworks.com/help/matlab/matlab_prog/add-help-for-your-program.html
Please add a filter to reuse, so we can use it easily.
Thanks for that insight @jonasstein There was already an issue open on supporting Matlab/Octave files #357 but that issue didn't speak of the preview.
To clarify, is this also true for comments on the top of the file? The documentation you linked shows an example of documentation below a function, but not at the top of a file.
One way to deal with this is to check if a comment block is present at the top of the file, and if so place SPDX headers below it. Would that work? Something like:
% This script does awesome stuff.
% Pass in the necessary parameters to make it work.
% This section is intended for preview and is skipped over by REUSE tool.
% SPDX-FileCopyrightText: 2022 Person <[email protected]>
%
% SPDX-License-Identifier: GPL-3.0-or-later
function answer = important_question()
% This is function documentation, REUSE doesn't care about this.
answer = 42
Thanks to the linked documentation I was able to confirm the comment style conclusion from the other issue: https://de.mathworks.com/help/matlab/matlab_prog/comments.html
@nicorikken Yes. There is a fruitful suggestion from the matlab staff on https://de.mathworks.com/matlabcentral/answers/1840853-how-to-use-spdx-licenseinformation-in-mat-matlab-files
Thank you for your time and contributions! Unfortunately, this issue has been inactive for quite a while which means we probably can't manage the time to deal with it. That's why we're marking it as stale. We want to keep things tidy and focus on active discussions, but we’re always happy to revisit if this is still relevant!
If you’d like to keep this open, please add a comment to let us know and remove the label stale. Otherwise, this issue will most likely be automatically closed soon.
Since there hasn't been any recent activity after the last message, we're going to go ahead and close this issue. Feel free to reopen this and remove the labels stale and unresolved if it's urgent.
We truly appreciate your contributions and engagement!
Thank you and happy hacking!