florianschanda / miss_hit

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

Copyright statement in the second top-level comment block #259

Closed drittelhacker closed 1 year ago

drittelhacker commented 2 years ago

What kind of feature is this?

Your MATLAB/Octave environment

MISS_HIT component affected Choose one or more of the below:

Describe the solution you'd like In our projects, we usually have something like:

function [outputArg1,outputArg2] = untitled(inputArg1,inputArg2)
%UNTITLED Summary of this function goes here
%   Detailed explanation goes here

%
% This file is part of the foo project 
% (http://my.url.to/project/foo).
% Copyright (c) 2022 foo developers and contributors.
% All rights reserved.
% License: BSD 2-Clause License (see COPYING)
%

outputArg1 = inputArg1;
outputArg2 = inputArg2;
end

This way, we do not print the license statement every time users check for the help, but still comply to the license-at-the-top rules in open source software. Removing the empty line between the two comments makes the copyright tool and style checker find the copyright statement already. It would be great if both would also support this style, with the extra blank line.

florianschanda commented 1 year ago

First, sorry in the month long delay.

Second, this sounds like something I could do fairly easily.

drittelhacker commented 1 year ago

Sounds great. Take your time. This would be really nice to have, but is also not urgent at all.

florianschanda commented 1 year ago

This is now implement and will be in the next release (which I will make today).

drittelhacker commented 1 year ago

Many thanks! I just tested the copyright detection of mh_style on one of our projects with almost 400 m-files, and it worked flawlessly. Nice work.