Skip to content

Commit

Permalink
Merge pull request #4 from stephenfin/use-warning-is-error
Browse files Browse the repository at this point in the history
Use warning is error
  • Loading branch information
dhellmann authored Oct 10, 2017
2 parents f5b8a84 + 58a0c44 commit e6ee9ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 0 additions & 2 deletions nosetest.cfg

This file was deleted.

8 changes: 4 additions & 4 deletions sphinxcontrib/spelling/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class SpellingBuilder(Builder):
def init(self):
self.docnames = []
self.document_data = []
self.misspelling_count = 0

# Initialize the per-document filters
if not hasattr(self.env, 'spelling_document_filters'):
Expand Down Expand Up @@ -136,10 +137,7 @@ def write_doc(self, docname, doctree):
lineno, word,
self.format_suggestions(suggestions),
))

# We found at least one bad spelling, so set the status
# code for the app to a value that indicates an error.
self.app.statuscode = 1
self.misspelling_count += 1

self.checker.pop_filters()
return
Expand All @@ -148,4 +146,6 @@ def finish(self):
self.output.close()
self.info('Spelling checker messages written to %s' %
self.output_filename)
if self.misspelling_count:
self.warning('Found %d misspelled words' % self.misspelling_count)
return

1 comment on commit e6ee9ca

@avylove
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to break on Sphinx >= 1.6

Exception occurred:
  File "/home/avram/github/enlighten/.tox/docs/lib/python3.6/site-packages/sphinxcontrib/spelling/builder.py", line 150, in finish
    self.warning('Found %d misspelled words' % self.misspelling_count)
AttributeError: 'SpellingBuilder' object has no attribute 'warning'

Please sign in to comment.