diff options
author | Ben Gamari <ben@smart-cactus.org> | 2017-08-22 11:51:54 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-08-22 18:01:06 -0400 |
commit | 7463a95dbe53d789f8f245f26735a7ac74bb6e11 (patch) | |
tree | 9eaaf75f720b2e9e1f163823ddde3684b4bbb2d8 /docs/users_guide/flags.py | |
parent | 3625728a0e3a9b56c2b85ae7ea8bcabdd83ece6a (diff) | |
download | haskell-7463a95dbe53d789f8f245f26735a7ac74bb6e11.tar.gz |
users-guide: Better error messages on incomplete ghc-flag directives
Diffstat (limited to 'docs/users_guide/flags.py')
-rw-r--r-- | docs/users_guide/flags.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/docs/users_guide/flags.py b/docs/users_guide/flags.py index 06223b599c..5a1ff51bab 100644 --- a/docs/users_guide/flags.py +++ b/docs/users_guide/flags.py @@ -28,6 +28,7 @@ from docutils import nodes from docutils.parsers.rst import Directive, directives from sphinx import addnodes from sphinx.domains.std import GenericObject +from sphinx.errors import SphinxError ### Settings @@ -125,6 +126,12 @@ class Flag(GenericObject): if 'noindex' in self.options: return + # Validity checking + if 'shortdesc' not in self.options: + raise SphinxError('ghc-flag (%s) directive missing :shortdesc: key' % self.names) + if 'type' not in self.options: + raise SphinxError('ghc-flag (%s) directive missing :type: key' % self.names) + # Set the flag category (default: misc) self.category = 'misc' if not 'category' in self.options or self.options['category'] == '': |