File: .lake/packages/lean4/src/lean/Lean/Linter/MissingDocs.lean

full_name: Lean.Linter.initFn._@..lake.packages.lean4.src.lean.Lean.Linter.MissingDocs._hyg.8
code: register_builtin_option linter.missingDocs : Bool := {
  defValue := false
  descr := "enable the 'missing documentation' linter"
}
goal: IO (Lean.Option Bool)

full_name: Lean.Linter.linter.missingDocs
code: register_builtin_option linter.missingDocs : Bool := {
  defValue := false
  descr := "enable the 'missing documentation' linter"
}
goal: Lean.Option Bool

full_name: Lean.Linter.getLinterMissingDocs
code: def getLinterMissingDocs (o : Options) : Bool 
goal: Bool

full_name: Lean.Linter.MissingDocs.SimpleHandler
code: abbrev SimpleHandler 
goal: Type

full_name: Lean.Linter.MissingDocs.Handler
code: abbrev Handler 
goal: Type

full_name: Lean.Linter.MissingDocs.SimpleHandler.toHandler
code: def SimpleHandler.toHandler (h : SimpleHandler) : Handler 
goal: Lean.Linter.MissingDocs.Handler

full_name: Lean.Linter.MissingDocs.mkHandlerUnsafe
code: unsafe def mkHandlerUnsafe (constName : Name) : ImportM Handler 
goal: Lean.ImportM Lean.Linter.MissingDocs.Handler

full_name: Lean.Linter.MissingDocs.mkHandler
code: @[implemented_by mkHandlerUnsafe]
opaque mkHandler (constName : Name) : ImportM Handler
goal: Lean.ImportM Lean.Linter.MissingDocs.Handler

full_name: Lean.Linter.MissingDocs.builtinHandlersRef
code: builtin_initialize builtinHandlersRef : IO.Ref (NameMap Handler) ← IO.mkRef {}
goal: IO.Ref (Lean.NameMap Lean.Linter.MissingDocs.Handler)

full_name: Lean.Linter.MissingDocs.initFn._@..lake.packages.lean4.src.lean.Lean.Linter.MissingDocs._hyg.332
code: builtin_initialize builtinHandlersRef : IO.Ref (NameMap Handler) ← IO.mkRef {}
goal: IO (IO.Ref (Lean.NameMap Lean.Linter.MissingDocs.Handler))

full_name: Lean.Linter.MissingDocs.missingDocsExt
code: builtin_initialize missingDocsExt :
  PersistentEnvExtension (Name × Name) (Name × Name × Handler) (List (Name × Name) × NameMap Handler) ←
  registerPersistentEnvExtension {
    mkInitial       := return ([], ← builtinHandlersRef.get)
    addImportedFn   := fun as => do
      ([], ·) <$> as.foldlM (init := ← builtinHandlersRef.get) fun s as =>
        as.foldlM (init := s) fun s (n, k) => s.insert k <$> mkHandler n
    addEntryFn      := fun (entries, s) (n, k, h) => ((n, k)::entries, s.insert k h)
    exportEntriesFn := fun s => s.1.reverse.toArray
    statsFn := fun s => format "number of local entries: " ++ format s.1.length
  }
goal: Lean.PersistentEnvExtension (Lean.Name × Lean.Name) (Lean.Name × Lean.Name × Lean.Linter.MissingDocs.Handler)
  (List (Lean.Name × Lean.Name) × Lean.NameMap Lean.Linter.MissingDocs.Handler)

full_name: Lean.Linter.MissingDocs.initFn._@..lake.packages.lean4.src.lean.Lean.Linter.MissingDocs._hyg.374
code: builtin_initialize missingDocsExt :
  PersistentEnvExtension (Name × Name) (Name × Name × Handler) (List (Name × Name) × NameMap Handler) ←
  registerPersistentEnvExtension {
    mkInitial       := return ([], ← builtinHandlersRef.get)
    addImportedFn   := fun as => do
      ([], ·) <$> as.foldlM (init := ← builtinHandlersRef.get) fun s as =>
        as.foldlM (init := s) fun s (n, k) => s.insert k <$> mkHandler n
    addEntryFn      := fun (entries, s) (n, k, h) => ((n, k)::entries, s.insert k h)
    exportEntriesFn := fun s => s.1.reverse.toArray
    statsFn := fun s => format "number of local entries: " ++ format s.1.length
  }
goal: IO
  (Lean.PersistentEnvExtension (Lean.Name × Lean.Name) (Lean.Name × Lean.Name × Lean.Linter.MissingDocs.Handler)
    (List (Lean.Name × Lean.Name) × Lean.NameMap Lean.Linter.MissingDocs.Handler))

full_name: Lean.Linter.MissingDocs.addHandler
code: def addHandler (env : Environment) (declName key : Name) (h : Handler) : Environment 
goal: Lean.Environment

full_name: Lean.Linter.MissingDocs.getHandlers
code: def getHandlers (env : Environment) : NameMap Handler 
goal: Lean.NameMap Lean.Linter.MissingDocs.Handler

full_name: Lean.Linter.MissingDocs.missingDocs
code: partial def missingDocs : Linter 
goal: Lean.Linter

full_name: Lean.Linter.MissingDocs.initFn._@..lake.packages.lean4.src.lean.Lean.Linter.MissingDocs._hyg.778
code: builtin_initialize addLinter missingDocs
goal: IO Unit

full_name: Lean.Linter.MissingDocs.addBuiltinHandler
code: def addBuiltinHandler (key : Name) (h : Handler) : IO Unit 
goal: IO Unit

full_name: Lean.Linter.MissingDocs.initFn._@..lake.packages.lean4.src.lean.Lean.Linter.MissingDocs._hyg.810
code: builtin_initialize
  let mkAttr (builtin : Bool) (name : Name) := registerBuiltinAttribute {
    name
    descr           := (if builtin then "(builtin) " else "") ++
      "adds a syntax traversal for the missing docs linter"
    applicationTime := .afterCompilation
    add             := fun declName stx kind => do
      unless kind == AttributeKind.global do throwError "invalid attribute '{name}', must be global"
      let env ← getEnv
      unless builtin || (env.getModuleIdxFor? declName).isNone do
        throwError "invalid attribute '{name}', declaration is in an imported module"
      let decl ← getConstInfo declName
      let fnNameStx ← Attribute.Builtin.getIdent stx
      let key ← Elab.realizeGlobalConstNoOverloadWithInfo fnNameStx
      unless decl.levelParams.isEmpty && (decl.type == .const ``Handler [] || decl.type == .const ``SimpleHandler []) do
        throwError "unexpected missing docs handler at '{declName}', `MissingDocs.Handler` or `MissingDocs.SimpleHandler` expected"
      if builtin then
        let h := if decl.type == .const ``SimpleHandler [] then
          mkApp (mkConst ``SimpleHandler.toHandler) (mkConst declName)
        else mkConst declName
        declareBuiltin declName <| mkApp2 (mkConst ``addBuiltinHandler) (toExpr key) h
      else
        setEnv <| missingDocsExt.addEntry env (declName, key, ← mkHandler declName)
  }
  mkAttr true `builtin_missing_docs_handler
  mkAttr false `missing_docs_handler
goal: IO Unit

full_name: Lean.Linter.MissingDocs.lint
code: def lint (stx : Syntax) (msg : String) : CommandElabM Unit 
goal: Lean.Elab.Command.CommandElabM Unit

full_name: Lean.Linter.MissingDocs.lintNamed
code: def lintNamed (stx : Syntax) (msg : String) : CommandElabM Unit 
goal: Lean.Elab.Command.CommandElabM Unit

full_name: Lean.Linter.MissingDocs.lintField
code: def lintField (parent stx : Syntax) (msg : String) : CommandElabM Unit 
goal: Lean.Elab.Command.CommandElabM Unit

full_name: Lean.Linter.MissingDocs.lintStructField
code: def lintStructField (parent stx : Syntax) (msg : String) : CommandElabM Unit 
goal: Lean.Elab.Command.CommandElabM Unit

full_name: Lean.Linter.MissingDocs.hasInheritDoc
code: def hasInheritDoc (attrs : Syntax) : Bool 
goal: Bool

full_name: Lean.Linter.MissingDocs.declModifiersPubNoDoc
code: def declModifiersPubNoDoc (mods : Syntax) : Bool 
goal: Bool

full_name: Lean.Linter.MissingDocs.lintDeclHead
code: def lintDeclHead (k : SyntaxNodeKind) (id : Syntax) : CommandElabM Unit 
goal: Lean.Elab.Command.CommandElabM Unit

full_name: Lean.Linter.MissingDocs.checkDecl
code: @[builtin_missing_docs_handler declaration]
def checkDecl : SimpleHandler 
goal: Lean.Linter.MissingDocs.SimpleHandler

full_name: Lean.Linter.MissingDocs.checkInit
code: @[builtin_missing_docs_handler «initialize»]
def checkInit : SimpleHandler 
goal: Lean.Linter.MissingDocs.SimpleHandler

full_name: Lean.Linter.MissingDocs.checkNotation
code: @[builtin_missing_docs_handler «notation»]
def checkNotation : SimpleHandler 
goal: Lean.Linter.MissingDocs.SimpleHandler

full_name: Lean.Linter.MissingDocs.checkMixfix
code: @[builtin_missing_docs_handler «mixfix»]
def checkMixfix : SimpleHandler 
goal: Lean.Linter.MissingDocs.SimpleHandler

full_name: Lean.Linter.MissingDocs.checkSyntax
code: @[builtin_missing_docs_handler «syntax»]
def checkSyntax : SimpleHandler 
goal: Lean.Linter.MissingDocs.SimpleHandler

full_name: Lean.Linter.MissingDocs.mkSimpleHandler
code: def mkSimpleHandler (name : String) : SimpleHandler 
goal: Lean.Linter.MissingDocs.SimpleHandler

full_name: Lean.Linter.MissingDocs.checkSyntaxAbbrev
code: @[builtin_missing_docs_handler syntaxAbbrev]
def checkSyntaxAbbrev : SimpleHandler 
goal: Lean.Linter.MissingDocs.SimpleHandler

full_name: Lean.Linter.MissingDocs.checkSyntaxCat
code: @[builtin_missing_docs_handler syntaxCat]
def checkSyntaxCat : SimpleHandler 
goal: Lean.Linter.MissingDocs.SimpleHandler

full_name: Lean.Linter.MissingDocs.checkMacro
code: @[builtin_missing_docs_handler «macro»]
def checkMacro : SimpleHandler 
goal: Lean.Linter.MissingDocs.SimpleHandler

full_name: Lean.Linter.MissingDocs.checkElab
code: @[builtin_missing_docs_handler «elab»]
def checkElab : SimpleHandler 
goal: Lean.Linter.MissingDocs.SimpleHandler

full_name: Lean.Linter.MissingDocs.checkClassAbbrev
code: @[builtin_missing_docs_handler classAbbrev]
def checkClassAbbrev : SimpleHandler 
goal: Lean.Linter.MissingDocs.SimpleHandler

full_name: Lean.Linter.MissingDocs.checkSimpLike
code: @[builtin_missing_docs_handler Parser.Tactic.declareSimpLikeTactic]
def checkSimpLike : SimpleHandler 
goal: Lean.Linter.MissingDocs.SimpleHandler

full_name: Lean.Linter.MissingDocs.checkRegisterBuiltinOption
code: @[builtin_missing_docs_handler Option.registerBuiltinOption]
def checkRegisterBuiltinOption : SimpleHandler 
goal: Lean.Linter.MissingDocs.SimpleHandler

full_name: Lean.Linter.MissingDocs.checkRegisterOption
code: @[builtin_missing_docs_handler Option.registerOption]
def checkRegisterOption : SimpleHandler 
goal: Lean.Linter.MissingDocs.SimpleHandler

full_name: Lean.Linter.MissingDocs.checkRegisterSimpAttr
code: @[builtin_missing_docs_handler registerSimpAttr]
def checkRegisterSimpAttr : SimpleHandler 
goal: Lean.Linter.MissingDocs.SimpleHandler

full_name: Lean.Linter.MissingDocs.handleIn
code: @[builtin_missing_docs_handler «in»]
def handleIn : Handler 
goal: Lean.Linter.MissingDocs.Handler

full_name: Lean.Linter.MissingDocs.handleMutual
code: @[builtin_missing_docs_handler «mutual»]
def handleMutual : Handler 
goal: Lean.Linter.MissingDocs.Handler