Code template for Swift files

The Code Templates section of the Contributing Code page on swift.org says:

However, in the GitHub repo for the standard library, none of the Swift files appear to use that first line. Instead they begin like this:

//===--- Integers.swift ---------------------------------------------------===//

or this:

//===--- FloatingPoint.swift ----------------------------------*- swift -*-===//

or this (Bool.swift):

//===----------------------------------------------------------------------===//

Should this inconsistency between the first line of the template for Swift files and the files themselves be addressed? If so how?

I see 3 main options:

  • Update the Code Templates text to match what is being used in practice.
  • Change the Swift files in the standard library to match the template.
  • Use the template for new files, but leave existing ones alone.

I has been my experience that code headers like this are always stale in any non-trivial software with more than one author, so I don't think it matters at all. It's actually news to me that we even have this guidance. I would simply remove the section, personally, but I would also be OK with just bringing it in line with current practice.

4 Likes

Tangential to this, the License section of the Community page on swift.org says:

However, there is no file named CONTRIBUTORS.txt at the root of the Swift project, nor indeed anywhere in the project at all that I can find by searching.

There is a file with that name at swift.org/CONTRIBUTORS.txt, but it is not on Github and it also claims to be auto-generated. Moreover, I know that I personally have made pull requests which were accepted to the Swift project, but my name does not appear on that list.

CC @tkremenek for the contributors.txt question

Terms of Service

Privacy Policy

Cookie Policy