florianschanda / miss_hit

MATLAB Independent, Small & Safe, High Integrity Tools - code formatter and more
GNU General Public License v3.0
160 stars 21 forks source link

Consequence of the copyright format on the "help" function #202

Closed Remi-Gau closed 3 years ago

Remi-Gau commented 3 years ago

Maybe I am missing something obvious but is there a way to declare copyrights that would keep miss_hit happy and retain the ability to get the help section from the prompt?

help setDerivativesDir
  (C) Copyright 2020 CPP BIDS SPM-pipeline developers

function content:

 % (C) Copyright 2020 CPP BIDS SPM-pipeline developers   

function opt = setDerivativesDir(opt)
  %
  % Sets the derivatives folder and the directory where to save the SPM jobs.
  %
  % USAGE::
  %
  %   opt = setDerivativesDir(opt)
  ...
florianschanda commented 3 years ago

I think this is a duplicate of #121. Right now there is no way. But since two people now asked for it, maybe it's time to do it ;)

Remi-Gau commented 3 years ago

Yup totally a duplicate. I had missed it because it wasn't clear from the name of the other issue.

Closing this one.

florianschanda commented 3 years ago

I guess this is showing how little I actually know about MATLAB...

So I guess https://uk.mathworks.com/help/matlab/matlab_prog/add-help-for-your-program.html is how you're supposed to document your functions? I suppose a copyright notice, if it exists, goes right at the bottom of such a help text?

For octave it seems the current form works well: https://octave.org/doc/v4.0.1/Function-Headers.html#Function-Headers

Remi-Gau commented 3 years ago

I guess this is showing how little I actually know about MATLAB...

:sweat_smile: Don't worry I have been using it for years and just figured out about this Content.m thing when you posted about it.

So I guess https://uk.mathworks.com/help/matlab/matlab_prog/add-help-for-your-program.html is how you're supposed to document your functions? I suppose a copyright notice, if it exists, goes right at the bottom of such a help text?

I think I have seen it in such places more often indeed.

For octave it seems the current form works well: https://octave.org/doc/v4.0.1/Function-Headers.html#Function-Headers

Ha true!! I was not aware that the way to handle documentation and descriptions were "so" different between matlab and octave.

I'd be tempted to stick with a more matlab-ish approach and have only things in the function definition itself with the copyright at the bottom, since it seems to make everyone "happy" (matlab can handle, octave too even if that does not fit their recommended practice for headers).