diff options
Diffstat (limited to 'doc/data/messages/s')
5 files changed, 6 insertions, 9 deletions
diff --git a/doc/data/messages/s/self-cls-assignment/bad.py b/doc/data/messages/s/self-cls-assignment/bad.py index 64541405f..50fe89015 100644 --- a/doc/data/messages/s/self-cls-assignment/bad.py +++ b/doc/data/messages/s/self-cls-assignment/bad.py @@ -1,7 +1,7 @@ class Fruit: @classmethod def list_fruits(cls): - cls = 'apple' # [self-cls-assignment] + cls = "apple" # [self-cls-assignment] def print_color(self, *colors): self = "red" # [self-cls-assignment] diff --git a/doc/data/messages/s/self-cls-assignment/good.py b/doc/data/messages/s/self-cls-assignment/good.py index ae8b172fa..d1960f251 100644 --- a/doc/data/messages/s/self-cls-assignment/good.py +++ b/doc/data/messages/s/self-cls-assignment/good.py @@ -1,7 +1,7 @@ class Fruit: @classmethod def list_fruits(cls): - fruit = 'apple' + fruit = "apple" print(fruit) def print_color(self, *colors): diff --git a/doc/data/messages/s/simplifiable-if-statement/bad.py b/doc/data/messages/s/simplifiable-if-statement/bad.py index 0c9fb317f..1a8d6f0f7 100644 --- a/doc/data/messages/s/simplifiable-if-statement/bad.py +++ b/doc/data/messages/s/simplifiable-if-statement/bad.py @@ -2,7 +2,8 @@ FLYING_THINGS = ["bird", "plane", "superman", "this example"] def is_flying_animal(an_object): - if isinstance(an_object, Animal) and an_object in FLYING_THINGS: # [simplifiable-if-statement] + # +1: [simplifiable-if-statement] + if isinstance(an_object, Animal) and an_object in FLYING_THINGS: is_flying = True else: is_flying = False diff --git a/doc/data/messages/s/subprocess-popen-preexec-fn/bad.py b/doc/data/messages/s/subprocess-popen-preexec-fn/bad.py index c0d3f7bfa..6be75e472 100644 --- a/doc/data/messages/s/subprocess-popen-preexec-fn/bad.py +++ b/doc/data/messages/s/subprocess-popen-preexec-fn/bad.py @@ -5,4 +5,4 @@ def foo(): pass -subprocess.Popen(preexec_fn=foo) # [subprocess-popen-preexec-fn] +subprocess.Popen(preexec_fn=foo) # [subprocess-popen-preexec-fn] diff --git a/doc/data/messages/s/syntax-error/good.py b/doc/data/messages/s/syntax-error/good.py index eccab8746..10a644f1b 100644 --- a/doc/data/messages/s/syntax-error/good.py +++ b/doc/data/messages/s/syntax-error/good.py @@ -1,5 +1 @@ -fruit_stock = { - 'apple': 42, - 'orange': 21, - 'banana': 12 -} +fruit_stock = {"apple": 42, "orange": 21, "banana": 12} |