Skip to content

Commit

Permalink
WriteGoodLintBear: Correct usage of settings
Browse files Browse the repository at this point in the history
  • Loading branch information
AsnelChristian committed Aug 17, 2016
1 parent 62fb9d7 commit 270f162
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
20 changes: 10 additions & 10 deletions bears/natural_language/WriteGoodLintBear.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ class WriteGoodLintBear:

@staticmethod
def create_arguments(filename, file, config_file,
allow_passive_voice: bool=False,
allow_so_beginning: bool=False,
allow_adverbs: bool=False,
allow_repeated_words: bool=False,
allow_there_is: bool=False,
allow_ambiguous_words: bool=False,
allow_extra_words: bool=False,
allow_cliche_phrases: bool=False):
allow_passive_voice: bool=True,
allow_so_beginning: bool=True,
allow_adverbs: bool=True,
allow_repeated_words: bool=True,
allow_there_is: bool=True,
allow_ambiguous_words: bool=True,
allow_extra_words: bool=True,
allow_cliche_phrases: bool=True):
"""
Using ``True`` will enable the check.
Using ``False`` will enable the check.
:param allow_passive_voice: Allows passive voice.
:param allow_so_beginning: Allows ``So`` at the beginning of
Expand Down Expand Up @@ -63,5 +63,5 @@ def create_arguments(filename, file, config_file,
}
l = locals()
args = tuple(arg for key, arg in arg_map.items()
if l[key])
if not l[key])
return args + (filename,)
17 changes: 8 additions & 9 deletions tests/natural_language/WriteGoodLintBearTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
illusion_file),
settings={
"allow_passive_voice":
True})
False})

WriteGoodLintBearWithTooWordyTest = verify_local_bear(WriteGoodLintBear,
valid_files=(
Expand All @@ -63,7 +63,7 @@
so_file),
settings={
"allow_extra_words":
True})
False})

WriteGoodLintBearWithThereIsTest = verify_local_bear(WriteGoodLintBear,
valid_files=(
Expand All @@ -79,7 +79,7 @@
invalid_files=(),
settings={
"allow_there_is":
True})
False})

WriteGoodLintBearWithClicheTest = verify_local_bear(WriteGoodLintBear,
valid_files=(good_file,
Expand All @@ -95,7 +95,7 @@
cliche_file,),
settings={
"allow_cliche_phrases":
True})
False})

WriteGoodLintBearWithAdverbTest = verify_local_bear(WriteGoodLintBear,
valid_files=(
Expand All @@ -111,7 +111,7 @@
wordy_file,
adverb_file),
settings={"allow_adverbs":
True})
False})

WriteGoodLintBearWithSoTest = verify_local_bear(WriteGoodLintBear,
valid_files=(good_file,
Expand All @@ -125,7 +125,7 @@
invalid_files=(
bad_file, so_file,),
settings={"allow_so_beginning":
True})
False})

WriteGoodLintBearWithIllusionTest = verify_local_bear(WriteGoodLintBear,
valid_files=(
Expand All @@ -142,7 +142,7 @@
illusion_file,),
settings={
"allow_repeated_words":
True})
False})

WriteGoodLintBearWithWeaselTest = verify_local_bear(WriteGoodLintBear,
valid_files=(good_file,
Expand All @@ -159,5 +159,4 @@
adverb_file),
settings={
"allow_ambiguous_words":
True}
)
False})

0 comments on commit 270f162

Please sign in to comment.