Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

License headers in FOS bundles #14

Closed
stof opened this issue May 13, 2011 · 14 comments
Closed

License headers in FOS bundles #14

stof opened this issue May 13, 2011 · 14 comments

Comments

@stof
Copy link
Member

stof commented May 13, 2011

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
Copy link
Member

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
Copy link
Member

arghav commented May 13, 2011

Maybe take some inspiration from humans.txt? :)

@stof
Copy link
Member Author

stof commented May 13, 2011

@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
Copy link
Member

arghav commented May 13, 2011

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
Copy link
Member Author

stof commented May 13, 2011

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
Copy link
Member

arghav commented May 13, 2011

@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
Copy link
Member Author

stof commented May 13, 2011

@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
Copy link
Member

arghav commented May 13, 2011

@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
Copy link
Member

merk commented May 13, 2011

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
Copy link
Member Author

stof commented May 25, 2011

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

@lsmith77
Copy link
Member

sounds good to me.

@stof
Copy link
Member Author

stof commented May 25, 2011

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
Copy link
Member

merk commented Jun 2, 2011

@lsmith77
Copy link
Member

guess this can be closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants