FriendsOfSymfony / friendsofsymfony.github.io

Description of what FriendsOfSymfony (aka FoS) is about.
http://friendsofsymfony.github.io
32 stars 4 forks source link

License headers in FOS bundles #14

Closed stof closed 12 years ago

stof commented 13 years ago

The lincense header in the different FOS bundles are currently inconsistent (not only from a bundle to another but also inside the bundles which is a bigger issue). It would be great to choose a common one. Currently, many files have a license header refering to the guy writing the first implementation, others don't have any license headers... Would it make sense to put a license header refering to FOS and then put the name of the authors as @author annotations where they belong (which is still done in some places too) ?

lsmith77 commented 13 years ago

I dont actually know what the best practice in general is for license headers, but yes I agree it would be good for us to define a standard here, so Bundles are consistent and more importantly we dont each have to wonder how to do it :)

arghav commented 13 years ago

Maybe take some inspiration from humans.txt? :)

stof commented 13 years ago

@kertz The way they look currently (copied from the way the Sf2 one looks) is fine IMO. the issue is what we write as content.

arghav commented 13 years ago

I was suggesting something like the following in Resources/meta/humans.txt. Instead of having license headers in all the files, one place for all.

/* AUTHORS */
Your title: Your name.
Site: email, link to a contact form, etc.
Twitter: your Twitter username.
Location: City, Country.

                    [...]

/* THANKS */
Name: name or url

                    [...]

/* PROJECT */
License: MIT License[http://www.opensource.org/licenses/mit-license.php]
Language: English / Castellano / Català
Editors: VI, TextMate, PhpStorm etc.
stof commented 13 years ago

The license is still in meta. The other data you place in the PROJECT section don't make much sense. We are all using different IDE (or no IDE), we speak different languages... The list of contributors is available on github on the contributors page which avoids having to update it manually.

The point is precisely to decide what we place at the top of the file. Here is the example coming from the Symfony2 framework:


/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
arghav commented 13 years ago

@stof The whole idea of it is to share that we use different editors. Also about language, it's not what we speak but what we have used in the project. For example UserBundle has many translation files, so all those languages can go in there. This might not be a replacement for the license header but can avoid adding the authors in the header.

Something like...

/*
 * This file is part of the Symfony package.
 *
 * (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * To know more about the authors please view humans.txt file that was
 * distributed with this source code.
 */

This is just an idea anyway :)

stof commented 13 years ago

@kertz the @author annotation is about giving credits for the piece of code they wrote. Putting them in an authors.txt file only gives a list, which could as well be given by github by placing a link in the readme. And for the editors, adding them does not make much sense IMO. Some could think that they cannot use another editor, and this adds no value to the code. You could even code using Notepad on windows (well, only if you configure your git software to convert line endings to CRLF and back). The user don't care about what is used.

I also disagree with the first line. FOSUB is not part of the Symfony package. Same for other FOS bundles..

arghav commented 13 years ago

@stof Agree that it would confuse users if we add editors. Just scratch the whole idea, maybe it's better to stick with the way things are done right now and add @author to the header.

I just edited the Symfony license header but forgot to change the first line :)

merk commented 13 years ago

My suggestion:

/*
 * This file is part of FOS\BundleBundle.
 *
 * (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace FOS\BundleBundle\Bundle;

use FOS\BundleBundle\Bundle\Bundle as BundleBundle;

/**
 * The Bundle Bundle Bundle class.
 *
 * @author Person
 * @author Person
 */
class Bundle {}
stof commented 13 years ago

I used this suggestion in FOSUB in my refactoring branch. I suggest to do the change in the other FOS bundles as well.

lsmith77 commented 13 years ago

sounds good to me.

stof commented 13 years ago

to be exact, I used


/*
 * This file is part of the FOSUserBundle package.
 *
 * (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

this is a bit different for the first sentence, and matches the way Symfony does.

merk commented 13 years ago

FYI:

https://github.com/FriendsOfSymfony/CommentBundle/commit/e621357a91dc80eacb049f9e18517bb388c51ac9

lsmith77 commented 12 years ago

guess this can be closed