From ae564d28758adffa64afb9a736e0a8fdd6296b4c Mon Sep 17 00:00:00 2001 From: "Gunung P. Wibisono" <55311527+gunungpw@users.noreply.github.com> Date: Sun, 3 Apr 2022 19:08:32 +0700 Subject: [PATCH 1/5] add example for `undefined-all-variable` --- doc/data/messages/u/undefined-all-variable/bad.py | 12 ++++++++++++ doc/data/messages/u/undefined-all-variable/good.py | 12 ++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 doc/data/messages/u/undefined-all-variable/bad.py create mode 100644 doc/data/messages/u/undefined-all-variable/good.py diff --git a/doc/data/messages/u/undefined-all-variable/bad.py b/doc/data/messages/u/undefined-all-variable/bad.py new file mode 100644 index 0000000000..9362e89231 --- /dev/null +++ b/doc/data/messages/u/undefined-all-variable/bad.py @@ -0,0 +1,12 @@ +__all__ = [ + "pet", + "age", + "get_fruit_color", # [undefined-all-variable] +] + +pet = "Cat" +age = 10 + + +def get_pet_age(): + pass diff --git a/doc/data/messages/u/undefined-all-variable/good.py b/doc/data/messages/u/undefined-all-variable/good.py new file mode 100644 index 0000000000..2386168b95 --- /dev/null +++ b/doc/data/messages/u/undefined-all-variable/good.py @@ -0,0 +1,12 @@ +__all__ = [ + "pet", + "age", + "get_pet_age", # [undefined-all-variable] +] + +pet = "Cat" +age = 10 + + +def get_pet_age(): + pass From ca6e17d9eecb5d4d7a88063df0ad5c262f3a7085 Mon Sep 17 00:00:00 2001 From: "Gunung P. Wibisono" <55311527+gunungpw@users.noreply.github.com> Date: Sun, 3 Apr 2022 19:08:46 +0700 Subject: [PATCH 2/5] add `related.rst` --- doc/data/messages/u/undefined-all-variable/related.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/data/messages/u/undefined-all-variable/related.rst diff --git a/doc/data/messages/u/undefined-all-variable/related.rst b/doc/data/messages/u/undefined-all-variable/related.rst new file mode 100644 index 0000000000..78d6a9a3dc --- /dev/null +++ b/doc/data/messages/u/undefined-all-variable/related.rst @@ -0,0 +1 @@ +* `Importing * From a Package `_ \ No newline at end of file From 9a93dd18efeacca65a97f46e53d5fc047f081293 Mon Sep 17 00:00:00 2001 From: "Gunung P. Wibisono" <55311527+gunungpw@users.noreply.github.com> Date: Sun, 3 Apr 2022 19:09:50 +0700 Subject: [PATCH 3/5] fix comment --- doc/data/messages/u/undefined-all-variable/good.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/data/messages/u/undefined-all-variable/good.py b/doc/data/messages/u/undefined-all-variable/good.py index 2386168b95..6bbb6e27da 100644 --- a/doc/data/messages/u/undefined-all-variable/good.py +++ b/doc/data/messages/u/undefined-all-variable/good.py @@ -1,7 +1,7 @@ __all__ = [ "pet", "age", - "get_pet_age", # [undefined-all-variable] + "get_pet_age", ] pet = "Cat" From 6fde2b41b5767a3fd3bef597d1402a5ea07bd2f5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 3 Apr 2022 12:17:58 +0000 Subject: [PATCH 4/5] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- doc/data/messages/u/undefined-all-variable/related.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/data/messages/u/undefined-all-variable/related.rst b/doc/data/messages/u/undefined-all-variable/related.rst index 78d6a9a3dc..8929e8c04b 100644 --- a/doc/data/messages/u/undefined-all-variable/related.rst +++ b/doc/data/messages/u/undefined-all-variable/related.rst @@ -1 +1 @@ -* `Importing * From a Package `_ \ No newline at end of file +* `Importing * From a Package `_ From c15b996a4d50d29b9839cdaa1816bc521348ba20 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Sun, 3 Apr 2022 15:08:05 +0200 Subject: [PATCH 5/5] Apply suggestions from code review --- doc/data/messages/u/undefined-all-variable/bad.py | 12 ++---------- doc/data/messages/u/undefined-all-variable/good.py | 12 ++---------- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/doc/data/messages/u/undefined-all-variable/bad.py b/doc/data/messages/u/undefined-all-variable/bad.py index 9362e89231..dd7bef8cb8 100644 --- a/doc/data/messages/u/undefined-all-variable/bad.py +++ b/doc/data/messages/u/undefined-all-variable/bad.py @@ -1,12 +1,4 @@ -__all__ = [ - "pet", - "age", - "get_fruit_color", # [undefined-all-variable] -] +__all__ = ["get_fruit_colour"] # [undefined-all-variable] -pet = "Cat" -age = 10 - - -def get_pet_age(): +def get_fruit_color(): pass diff --git a/doc/data/messages/u/undefined-all-variable/good.py b/doc/data/messages/u/undefined-all-variable/good.py index 6bbb6e27da..3fb85e824c 100644 --- a/doc/data/messages/u/undefined-all-variable/good.py +++ b/doc/data/messages/u/undefined-all-variable/good.py @@ -1,12 +1,4 @@ -__all__ = [ - "pet", - "age", - "get_pet_age", -] +__all__ = ["get_fruit_color"] -pet = "Cat" -age = 10 - - -def get_pet_age(): +def get_fruit_color(): pass