akka / akka-http

The Streaming-first HTTP server/module of Akka
https://doc.akka.io/docs/akka-http
Other
1.34k stars 595 forks source link

Try using sbt-header v2 for our copy headers #1255

Closed ktoso closed 6 years ago

ktoso commented 7 years ago

As people keep forgetting to add the headers, and @hseeberger claims the v2.0 is much stabler than the initial version (which we attempted to use, but failed back them).

https://github.com/sbt/sbt-header (same for akka eventually, if we work it out here)

jiminhsieh commented 7 years ago

I tried sbt-header v3 locally. It produced this:

/*
 * Copyright 2014 Lightbend
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

This is the original header:

/**
 * Copyright (C) 2009-2017 Lightbend Inc. <http://www.lightbend.com>
 */

Which one you would like to use? If you want to use original header, it would need to write a custom license header in build.sbt.

ktoso commented 7 years ago

We should keep the "original header", license is in the LICENSE file, we don't add it to all files.

ktoso commented 7 years ago

Thanks for trying!

jiminhsieh commented 7 years ago

I have some questions of current header.

  1. There are 3 types of copyright text. 1.1. Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com> Which is the suggestion of copyright text. 1.2. Copyright (C) 2009-2017 Lightbend Inc. <http://www.lightbend.com> 1.3. Copyright (C) 2009-2017 Typesafe Inc. <http://www.typesafe.com>

  2. There are 3 types of comment style. 2.1. screen shot 2017-08-30 at 12 25 42 2.2. screen shot 2017-08-30 at 12 26 19 2.3. screen shot 2017-08-30 at 12 27 45 2.1 could be supported from sbt-header directly. 2.2 and 2.3 may be supported with extra code.

jiminhsieh commented 7 years ago

I could read LICENSE as text of header then set-header would try to insert to source code. But it would make lots of changes. Or maybe I could send a PR to let all of you know what's look like.

ktoso commented 7 years ago

The formatting style we should use is 2.1.

As for the dates - the date "from" is when the file was first committed and the latter is the current year. Perhaps we could be ok with the "2009 - current year" but I'm not a lawyer...

// cc @patriknw

jiminhsieh commented 7 years ago

I found there are some codes are not using Lightbend copyright. I would list some of those I think you would want to know first.

ktoso commented 7 years ago

And more, like the shaded protobuf.

In such cases both headers must be retained, the original one and the lightbend one can be added.