Skip to content

Commit

Permalink
HOTFIX damldoc: suppress instance docs when --data-only (digital-asse…
Browse files Browse the repository at this point in the history
  • Loading branch information
jberthold-da authored and mergify[bot] committed Sep 17, 2019
1 parent dc9429b commit 277bfcb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
15 changes: 12 additions & 3 deletions compiler/damlc/daml-doc/src/DA/Daml/Doc/Transform.hs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ applyTransform opts = distributeInstanceDocs . maybeDoAnnotations opts'
processWith (ExcludeModules rs : rest) ms
= maybeDoAnnotations rest $ filter (not . moduleMatchesAny (map withSlashes rs)) ms

processWith (DataOnly : rest) ms = maybeDoAnnotations rest $ map prune ms
processWith (DataOnly : rest) ms = maybeDoAnnotations rest $ map pruneNonData ms

processWith (IgnoreAnnotations : rest) ms = processWith rest ms

Expand All @@ -74,8 +74,17 @@ applyTransform opts = distributeInstanceDocs . maybeDoAnnotations opts'
-- went past it without finding IgnoreAnnotations, so apply them


prune :: ModuleDoc -> ModuleDoc
prune m = m{ md_functions = [], md_classes = [] }
-- When --data-only is chosen, remove all non-data documentation. This
-- includes functions, classes, and instances of all data types (but not
-- template instances).
pruneNonData :: ModuleDoc -> ModuleDoc
pruneNonData m = m{ md_functions = []
, md_classes = []
, md_instances = []
, md_adts = map noInstances $ md_adts m
}
noInstances :: ADTDoc -> ADTDoc
noInstances d = d{ ad_instances = Nothing }

-- conversions to use file pattern matcher

Expand Down
1 change: 1 addition & 0 deletions unreleased.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ This page contains release notes for the SDK.
HEAD — ongoing
--------------

* [DAML Docs] suppress instance documentation when `--data-only` mode is requested
+ [DAML-LF] add CAST_NUMERIC and SHIFT_NUMERIC in DAML-LF 1.dev

0 comments on commit 277bfcb

Please sign in to comment.