feat: More stats
This commit is contained in:
parent
1c303f8741
commit
63fcbf3da7
2 changed files with 22 additions and 2 deletions
|
@ -175,4 +175,19 @@ def noInformalDefs : MetaM Nat := do
|
|||
let x := x.filter (Informal.isInformalDef)
|
||||
pure x.toList.length
|
||||
|
||||
/-- The number of TODO items. -/
|
||||
def noTODOs : IO Nat := do
|
||||
let imports ← HepLean.allImports
|
||||
let x ← imports.mapM HepLean.Imports.getLines
|
||||
let x := x.flatten
|
||||
let x := x.filter fun l => l.startsWith "/-! TODO:"
|
||||
pure x.size
|
||||
|
||||
/-- The number of files with a TODO item. -/
|
||||
def noFilesWithTODOs : IO Nat := do
|
||||
let imports ← HepLean.allImports
|
||||
let x ← imports.mapM HepLean.Imports.getLines
|
||||
let x := x.filter (fun M => M.any fun l => l.startsWith "/-! TODO:")
|
||||
pure x.size
|
||||
|
||||
end HepLean
|
||||
|
|
|
@ -41,6 +41,8 @@ unsafe def Stats.toHtml : MetaM String := do
|
|||
let noLinesVal ← noLines
|
||||
let noInformalDefsVal ← noInformalDefs
|
||||
let noInformalLemmasVal ← noInformalLemmas
|
||||
let noTODOsVal ← noTODOs
|
||||
let noFilesWithTODOsVal ← noFilesWithTODOs
|
||||
let header := "---
|
||||
layout: default
|
||||
---
|
||||
|
@ -83,14 +85,17 @@ layout: default
|
|||
<h3>Number of Definitions (incl. instances): {noDefsVal - noInformalLemmasVal}</h3>
|
||||
<p>- Of which {noDefsVal - noDefsNoDocVal- noInformalLemmasVal} have doc-strings:</p>
|
||||
<progress value=\"{noDefsVal - noDefsNoDocVal- noInformalLemmasVal}\" max=\"{noDefsVal- noInformalLemmasVal}\"></progress>
|
||||
<p>- Of which {noDefsVal - noInformalLemmasVal - noInformalDefsVal} are not informal definitions:</p>
|
||||
<p>- Of which {noDefsVal - noInformalLemmasVal - noInformalDefsVal} are not <a href=\"https://heplean.github.io/HepLean/InformalGraph.html\">informal definitions</a>:</p>
|
||||
<progress value=\"{noDefsVal - noInformalLemmasVal - noInformalDefsVal}\" max=\"{noDefsVal - noInformalLemmasVal}\"></progress>
|
||||
|
||||
<h3>Number of Lemmas: {noLemmasVal + noInformalLemmasVal}</h3>
|
||||
<p>- Of which {noLemmasVal - noLemmasNoDocVal + noInformalLemmasVal} have doc-strings:</p>
|
||||
<progress value=\"{noLemmasVal - noLemmasNoDocVal + noInformalLemmasVal}\" max=\"{noLemmasVal + noInformalLemmasVal}\"></progress>
|
||||
<p>- Of which {noLemmasVal} are not informal lemmas:</p>
|
||||
<p>- Of which {noLemmasVal} are not <a href=\"https://heplean.github.io/HepLean/InformalGraph.html\">informal lemmas</a>:</p>
|
||||
<progress value=\"{noLemmasVal}\" max=\"{noLemmasVal + noInformalLemmasVal}\"></progress>
|
||||
<h3>Number of <a href=\"https://heplean.github.io/HepLean/TODOList\">TODOs</a>: {noTODOsVal}</h3>
|
||||
<p>- There are {noImportsVal - noFilesWithTODOsVal} (of {noImportsVal}) files which are TODO free:</p>
|
||||
<progress value=\"{noImportsVal - noFilesWithTODOsVal}\" max=\"{noImportsVal}\"></progress>
|
||||
"
|
||||
let footer := "
|
||||
</body>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue