-
Notifications
You must be signed in to change notification settings - Fork 331
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: rewrite the copyright header check in Lean (#13240)
This is one in a series of PRs rewriting most checks from `lint-style.py` in Lean. This PR moves the check for copyright headers and authors: the check has been rewritten anew (and is hopefully simpler to understand now); this has made it stricter in various places. The necessary adjustments have been made in #13212 and #13247. This PR also adds a `nolints` file for text-based linters.
- Loading branch information
1 parent
118f0d4
commit 871e03b
Showing
3 changed files
with
119 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
-- Manual exceptions for the text-based linters. | ||
-- This file is to `style-exceptions.txt` what `nolints.json` is to `@nolint` attributes: | ||
-- The latter is supposed to become and stay mostly empty over time (though files longer than | ||
-- 1500 lines can be transient exceptions for some longer time period), | ||
-- the former could be necessary in the long term. | ||
-- In this case, it's a side-effect of making the linter stricter than its Python ancestor. | ||
|
||
-- This file was recognised as import-only by the old heuristic, but not by the new, simpler one. | ||
Mathlib/Tactic/Linter.lean : line 2 : ERR_COP : Malformed or missing copyright header: Copyright line is malformed | ||
Mathlib/Tactic/Linter.lean : line 3 : ERR_COP : Malformed or missing copyright header: Second line should be "Released under Apache 2.0 license as described in the file LICENSE." | ||
Mathlib/Tactic/Linter.lean : line 4 : ERR_COP : Malformed or missing copyright header: The third line should describe the file's main authors | ||
|
||
-- The first line of the copyright is split in two (because of many authors, it is longer than | ||
-- 100 characters). Suggestion: tweak the line length linter and put this on one line? | ||
Archive/Sensitivity.lean : line 2 : ERR_COP : Malformed or missing copyright header: Copyright line is malformed | ||
Archive/Sensitivity.lean : line 3 : ERR_COP : Malformed or missing copyright header: Second line should be "Released under Apache 2.0 license as described in the file LICENSE." | ||
Archive/Sensitivity.lean : line 4 : ERR_COP : Malformed or missing copyright header: The third line should describe the file's main authors |