Addition to coding standards: Including names in code

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
greggles's picture

I thought I had seen discussion of this, but can't find it now.

In this issue I mention what I consider to be the standard: we don't include author names in the code itself. We can include them in a MAINTAINERS.txt or a README.txt but shouldn't put them in the code.

  1. It's "what core does" and when in doubt modules and themes should "do what core does."
  2. It would bloat the code to include all authors of patches in a file. If we don't include all authors, then this is not an accurate piece of information.

So, is anyone aware of a place where this has been decided? Is anyone pro or con on this topic?

If we decide this is the standard I think it should be communicated in the coding standards.

Comments

---

apaderno's picture

I was going to suggest that the file could be automatically updated basing on the commit messages, but I then realized it would not work all times.

When users provide a patch that resolves an issue, their usernames are normally listed in the motivation message. The vice versa is not always true; if I report a user name in a commit message, it doesn't mean the user has provided a patch (it could be the user described how the code should be changed in order to fix it)

The arguments don't make much

mikey_p's picture

The arguments don't make much sense for contrib. There are modules where I am the only person who wrote the code, and I do this in modules for clients that aren't on drupal.org, it really just depends on the use case, but a large majority of the modules (not the top 100) only have 1 person working on them without patches, so I don't see why a copyright notice, and name would be a bad thing.

consistency/simplicity & encouraging contributions

greggles's picture

I somewhat see your point, but I think there are two reasons why I feel we should adopt this even for low usage contrib.

  1. Consistency and simplicity are fundamental things we strive for in our policies. Can you imagine a scenario where we said "modules with a single author can retain the @author comment"? That could lead to people not accepting patches because they don't want to lose the attribution.
  2. Personally, if I see the author name in the code I'm turned off by it and tend not to contribute to the project and I imagine there are some like that. So, it's counterproductive to keep your name in the code (if you want help).

This is definitely only for code hosted on d.o. People who are writing a private module should do whatever they please.

The biggest problem with

mikey_p's picture

The biggest problem with this, that I see, is that it's starting to become very unclear what drupal.org is for. Sure it's for development of drupal itself, but with the git migrations and some of the features in the works for that it appears that drupal.org is starting to become a bit of a competitor to other project management/hosting portals, i.e. gitorious, github, sourceforge, etc. If that's the case I'm really starting to wonder where the lines are here:

  1. On one side are the folks who run d.o who want to keep up high quality, secure, legal projects, and have within their right to decide what is and isn't okay (I normally side with this group).

  2. Yet on the other hand, when reading your response it really struck me as a somewhat excessive show of control over how you want my module to look. If the goal of the Drupal community is to take over control of code with my name on it, that needs to very clear when registering and starting a project and those terms need to be prominent, published, and not applied retroactively to projects.

I can't help but think that while it is within the right of drupal.org to run it's infrastructure as it sees fit, recent instances of folks taking over control of other modules and such isn't going to encourage anyone to post their code here, and it's really confirming my decision to start using github and my own hosting when possible.

Edit: After reading your post again, I think my main point is, that this won't necessarily encourage contributions, if folks don't see drupal.org as a good place to host their code.

---

apaderno's picture

Even if I am the only one to write the code of a module, it can happen that I change the code basing on what reported in the issue queue.
Somebody wonders why I wrote the code in that way, and opens a reporting asking if it would not be better to write it in a different way; I notice the report, and I see that the code I wrote misses an important part, and it should not work in some circumstances.

In this case, if I would write that I am the only author of the code, I would lie, as without the report opened from somebody else I would not have noted the missing code. It's true he didn't write the code, but he helped.
That is why I think the code should not contain any author names.

This is clearly referred to code hosted on drupal.org; we don't make rules for code hosted somewhere else.

---

apaderno's picture

I think my main point is, that this won't necessarily encourage contributions

We also tend to discourage duplication of projects, and we have other requirements for who applies for a CVS account. I don't think that we should be worried to not encourage contributions more of other aspects.

Personally, if I see the

sun's picture

Personally, if I see the author name in the code I'm turned off by it and tend not to contribute to the project and I imagine there are some like that. So, it's counterproductive to keep your name in the code (if you want help).

100% agreed. Kills Drupal culture. Project maintenance (or not) is hard enough to struggle with. No need for additional authorship wars.

Daniel F. Kudwien
netzstrategen

Personally I'm turned off

mikey_p's picture

Personally I'm turned off when I see more and more rules about how my module must be written and the way I work, if I want my code to be on drupal.org. After all this do people still wonder why developers are switching to GitHub? This seriously make me more motivated to get my own project hosting site up and running so I can stop with the hassles of posting new modules on drupal.org.

In all honesty if we don't allow @author or copyright notice in code, then the packaging system needs to be fixed to add a COPYRIGHT.txt to every package that is downloaded.

Also what is to stop a project maintainer from requiring that users that submit patches to his project assign copyright to the module author? This is what the FSF requires from it's contributors.

As someone who has put Drupal

joachim's picture

As someone who has put Drupal modules on github, my only reason for doing so was technical: the ease of use of Git. Come the Great Git Migration and github will be forgotten :)

I don't think this is an unreasonable request.

In my experience, an author name in the code lingers long after that particular person has semi-left the project and other people are making commits. It then becomes difficult to know at what point to remove the name; and it's also misleading to users of the code.

---

apaderno's picture

I took over some modules, and I am co-maintaining where the original maintainer doesn't make commits anymore.
I agree with joachim that in the cases he reported, to leave the author name is misleading.

Drupal.org policies

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week