MagicMirror icon indicating copy to clipboard operation
MagicMirror copied to clipboard

Cleanup file headers

Open khassel opened this issue 1 year ago • 6 comments

See discussion here.

Beside the author headers: Need we in every file the MIT Licensed stuff?

Any other cleanup wishes?

khassel avatar Jan 16 '24 19:01 khassel

For the author headers: find ./ -type f -exec sed -i -r '/^\s\* By.*$/d' {} \;

khassel avatar Jan 16 '24 19:01 khassel

In my understanding of MIT, it is not necessary to mention the license in all files. But I think it's fine to do it.

As a basis for discussion, here is the current header from app.js:

   /* MagicMirror²
   * The Core App (Server)
   *
   * By Michael Teeuw https://michaelteeuw.nl
   * MIT Licensed.
   */

And here three spontaneous proposals:

Proposal 1: author line removed + asterisk below each other

  /*
   * MagicMirror²
   * The Core App (Server)
   *
   * MIT Licensed.
   */

Proposal 2: author line removed + license note formulated in more detail + asterisk below each other

 /*
  * MagicMirror²
  * The Core App (Server)
  *
  * This source code is licensed under the MIT license found in the
  * LICENSE file in the root directory of this source tree.
  */

Proposal 3: author line and license note removed + asterisk below each other

 /*
  * MagicMirror²
  * The Core App (Server)
  */

Feel free to tear these proposals apart. The license part in proposal 2 I found in the sources of react.

KristjanESPERANTO avatar Jan 16 '24 19:01 KristjanESPERANTO

There are even a few ESLint plugins that check the headers. Here is the rule of one of them that seems suitable: https://github.com/nikku/eslint-plugin-license-header/blob/master/docs/rules/header.md

The example there looks very similar to proposal 2.

  /**
   * Copyright (c) Foo Corp.
   *
   * This source code is licensed under the WTFPL license found in the
   * LICENSE file in the root of this projects source tree.
   */

Edit: But with the ESLint plugin approach, I now see the downside that the headers have to be the same everywhere... Additions like "The Core App (Server)" couldn't be in that block.

KristjanESPERANTO avatar Jan 16 '24 20:01 KristjanESPERANTO

Proposal 4: Remove headers alltogether. They provide no real information. I would rather have proper jsdoc headers everywhere ;-)

rejas avatar Jan 18 '24 10:01 rejas

from my side we can remove all these headers ...

khassel avatar Jan 18 '24 17:01 khassel

I'm also fine with removing :+1:

KristjanESPERANTO avatar Jan 18 '24 21:01 KristjanESPERANTO

so I guess this is done and can be closed @khassel ?

rejas avatar Mar 21 '24 13:03 rejas