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

Add filter for matlab files #604

Open
jonasstein opened this issue Oct 12, 2022 · 2 comments
Open

Add filter for matlab files #604

jonasstein opened this issue Oct 12, 2022 · 2 comments
Labels
comment-styles Request for a new comment style, or fixing a bug with these good first issue Good for newcomers

Comments

@jonasstein
Copy link

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.

@carmenbianca carmenbianca added good first issue Good for newcomers comment-styles Request for a new comment style, or fixing a bug with these labels Oct 12, 2022
@nicorikken
Copy link
Member

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 <person@server.org>
%
% 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

@jonasstein
Copy link
Author

kbroch-rivosinc added a commit to kbroch-rivosinc/reuse-tool that referenced this issue Jun 29, 2024
carmenbianca pushed a commit to kbroch-rivosinc/reuse-tool that referenced this issue Jul 1, 2024
carmenbianca added a commit that referenced this issue Jul 1, 2024
…ctave-file-support

add octave/matlab file format support #357 #604
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comment-styles Request for a new comment style, or fixing a bug with these good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants