Discussion:
[Hacking] License headers in empty files
(too old to reply)
Roman Prykhodchenko
2013-11-28 17:06:46 UTC
Permalink
Hi folks,

according to our hacking rules all source files should contain the Apache license header in the beginning (http://docs.openstack.org/developer/hacking/#openstack-licensing).
There are special files that in most of the cases are empty, i.e., __init__.py.

I used to put license headers to __init__ files when I was working on Neutron or Ironic. However, recently I got
a feedback for one of my patches from several folks that said that licence headers should be removed from __init__ files because
empty files are not source files.

The point of this email is _not_ to blame someone or to push my personal opinion to the folks who gave me the feedback. What I'm trying to do is to to bring more clarity to our hacking rules because, as I see, currently different folks interpret them differently.


- Roman
Denis Makogon
2013-11-28 17:14:00 UTC
Permalink
Good question, Roman. I'm also interested in this. Are there any
best-practices of header usage ? Should we place headers whereven it needs ?
Post by Roman Prykhodchenko
Hi folks,
according to our hacking rules all source files should contain the Apache
license header in the beginning (
http://docs.openstack.org/developer/hacking/#openstack-licensing).
There are special files that in most of the cases are empty, i.e., __init__.py.
I used to put license headers to __init__ files when I was working on
Neutron or Ironic. However, recently I got
a feedback for one of my patches from several folks that said that licence
headers should be removed from __init__ files because
empty files are not source files.
The point of this email is _not_ to blame someone or to push my personal
opinion to the folks who gave me the feedback. What I'm trying to do is to
to bring more clarity to our hacking rules because, as I see, currently
different folks interpret them differently.
- Roman
_______________________________________________
OpenStack-dev mailing list
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Julien Danjou
2013-11-28 18:01:55 UTC
Permalink
Post by Roman Prykhodchenko
The point of this email is _not_ to blame someone or to push my personal
opinion to the folks who gave me the feedback. What I'm trying to do is to
to bring more clarity to our hacking rules because, as I see, currently
different folks interpret them differently.
Anyway, having headers in empty file sounds just dumb.

Maybe a mistake that has been transformed into a rule?
--
Julien Danjou
// Free Software hacker / independent consultant
// http://julien.danjou.info
Sean Dague
2013-11-28 18:08:41 UTC
Permalink
Post by Julien Danjou
Post by Roman Prykhodchenko
The point of this email is _not_ to blame someone or to push my personal
opinion to the folks who gave me the feedback. What I'm trying to do is to
to bring more clarity to our hacking rules because, as I see, currently
different folks interpret them differently.
Anyway, having headers in empty file sounds just dumb.
Maybe a mistake that has been transformed into a rule?
When we wrote the hacking rule for the license check basically we didn't
want to overreach and cause a ton of work on projects to purge this. So
basically any file < 10 lines, we don't enforce the Apache license
header check. This allows __init__.py files to be either empty (which is
what they should be), or have the header. It just doesn't check for
trivially small files.

I'm totally in favor of going further and saying "empty files shouldn't
have license headers, because their content of emptiness isn't
copyrightable" [1]. That's just not how it's written today.

-Sean

1. Philip Glass might disagree -
http://en.wikipedia.org/wiki/4%E2%80%B233%E2%80%B3
--
Sean Dague
http://dague.net
Julien Danjou
2013-11-28 19:01:01 UTC
Permalink
Post by Sean Dague
I'm totally in favor of going further and saying "empty files shouldn't
have license headers, because their content of emptiness isn't
copyrightable" [1]. That's just not how it's written today.
I went ahead and sent a first patch:

https://review.openstack.org/#/c/59090/

Help appreciated. :)
--
Julien Danjou
-- Free Software hacker - independent consultant
-- http://julien.danjou.info
Julien Danjou
2013-12-02 17:37:19 UTC
Permalink
Post by Julien Danjou
Post by Sean Dague
I'm totally in favor of going further and saying "empty files shouldn't
have license headers, because their content of emptiness isn't
copyrightable" [1]. That's just not how it's written today.
https://review.openstack.org/#/c/59090/
Help appreciated. :)
The patch is ready for review, but it also a bit stricter as it
completely disallows files with _only_ comments in them.

This is something that sounds like a good idea, but Joe wanted to bring
this to the mailing list for attention first, in case there would be a
problem.
--
Julien Danjou
# Free Software hacker # independent consultant
# http://julien.danjou.info
Ben Nemec
2013-12-04 16:18:27 UTC
Permalink
Post by Julien Danjou
Post by Julien Danjou
Post by Sean Dague
I'm totally in favor of going further and saying "empty files shouldn't
have license headers, because their content of emptiness isn't
copyrightable" [1]. That's just not how it's written today.
https://review.openstack.org/#/c/59090/
Help appreciated. :)
The patch is ready for review, but it also a bit stricter as it
completely disallows files with _only_ comments in them.
This is something that sounds like a good idea, but Joe wanted to bring
this to the mailing list for attention first, in case there would be a
problem.
For reference, I believe the primary concern was that this would require
the removal of a few author comments in empty files, such as this:
https://github.com/openstack/nova/blob/master/nova/network/security_group/__init__.py#L18

I don't see a problem with that (the files with actual code also have
the author comment, so it will still be clear who wrote it, and of
course Git knows all of this too), but I agree that this is not
something we want to do without giving people the opportunity to discuss
it.

-Ben

Roman Prykhodchenko
2013-11-28 19:01:54 UTC
Permalink
Sean, Julien,

Than really makes sense. I've seen cases when guys -1ed patches for not having the header
in empty files referring to that "...all source files..." phrase. That's why I think it's reasonable to
add your comments to the Hacking rules.

- Roman
Post by Sean Dague
Post by Julien Danjou
Post by Roman Prykhodchenko
The point of this email is _not_ to blame someone or to push my personal
opinion to the folks who gave me the feedback. What I'm trying to do is to
to bring more clarity to our hacking rules because, as I see, currently
different folks interpret them differently.
Anyway, having headers in empty file sounds just dumb.
Maybe a mistake that has been transformed into a rule?
When we wrote the hacking rule for the license check basically we didn't
want to overreach and cause a ton of work on projects to purge this. So
basically any file < 10 lines, we don't enforce the Apache license
header check. This allows __init__.py files to be either empty (which is
what they should be), or have the header. It just doesn't check for
trivially small files.
I'm totally in favor of going further and saying "empty files shouldn't
have license headers, because their content of emptiness isn't
copyrightable" [1]. That's just not how it's written today.
-Sean
1. Philip Glass might disagree -
http://en.wikipedia.org/wiki/4%E2%80%B233%E2%80%B3
--
Sean Dague
http://dague.net
Continue reading on narkive:
Loading...