Skip to content

Commit

Permalink
add info about authorship, recommend putting imports on their own lines
Browse files Browse the repository at this point in the history
  • Loading branch information
bryangingechen authored and robertylewis committed Jun 16, 2020
1 parent 2e170f7 commit 48385b7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
11 changes: 7 additions & 4 deletions templates/contribute/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ using the [Lean doc preview page](https://observablehq.com/@bryangingechen/githu
## Header comment

Each mathlib file should start with:
* a header comment with copyright information;
* the list of imports;
* a header comment with copyright information (see the [recommendations in our style guidelines](style.html#header-and-imports));
* the list of imports (one on each line);
* a module docstring containing general documentation, written using Markdown.

(See the example below.)
Expand Down Expand Up @@ -43,8 +43,11 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Robert Y. Lewis
-/
import data.rat algebra.gcd_domain algebra.field_power
import ring_theory.multiplicity tactic.ring
import data.rat
import algebra.gcd_domain
import algebra.field_power
import ring_theory.multiplicity
import tactic.ring
import data.real.cau_seq
import tactic.norm_cast
Expand Down
17 changes: 12 additions & 5 deletions templates/contribute/style.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ easier to read, especially on a small screen or in a small window.
### Header and imports ###

The file header should contain copyright information, a list of all
the authors who have worked on the file, and a description of the
contents. Do all `import`s right after the header, without a line
break. You can also open namespaces in the same block.
the authors who have made significant contributions to the file, and
a description of the contents. Do all `import`s right after the header,
without a line break, on separate lines. You can also open namespaces
in the same block.

```lean
/-
Expand All @@ -41,13 +42,19 @@ Released under Apache 2.0 license as described in the file LICENSE.
Author: Joe Cool.
-/
import data.nat algebra.group
import data.nat
import algebra.group
open nat eq.ops
```

(Tip: If you're editing mathlib in VS Code, you can write `copy`
and then press <kbd>TAB</kbd> to generate a skeleton of the copyright header.)

Regarding the list of authors: we don't have strict rules on what
contributions qualify for inclusion there. The general idea is that
the people listed there should be the ones we would reach out to if we had
questions about the design or development of the Lean code.

### Module docstrings

After the copyright header and the imports,
Expand All @@ -59,7 +66,7 @@ please add a module docstring containing
- references to the literature (if any)

In total, the module docstring should look something like this:
```
```markdown
# Foos and bars

In this file we introduce `foo` and `bar`,
Expand Down

0 comments on commit 48385b7

Please sign in to comment.