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

Copyright should also be allowed for the format which is recognized by Octave's get_help_text #220

Closed quazgar closed 3 years ago

quazgar commented 3 years ago

What kind of feature is this?

MISS_HIT component affected

Describe the solution you'd like

Currently, miss_hit only recognizes (C) Copyright as the beginning of a copyright notice. Unfortunately, this is not recognized by Octave's get_help_text() function, and so the sometimes pretty verbose copyright text ends up in the help text and possibly HTML documentation. get_help_text() does however recognize the string Copyright (C) and will omit such a comment paragraph.

Teaching miss_hit to also accept Copyright (C) would make both sides happy.

How I can help

I am willing to help with rewriting the copyright_notice regex, but I do not know if there are unintended side effects for the automatic copyright notice tools.

florianschanda commented 3 years ago

Great suggestion. I really should do more in the area of Octave support.

florianschanda commented 3 years ago

@quazgar I have fixed this. Sorry I could not use your PR, but as you identified here already there was work required in the mh_copyright tool.

I have updated the default regex to accept either (c) Copyright... or Copyright (c)... (but not (c) Copyright (c)). You can also use capitals. The mh_copyright tool now also does the right thing (by copying the existing style, and giving you a way to specify what you want in case there is no notice at all).