From 77dd1b40af2019c61a8a8781aa35b43f716c1711 Mon Sep 17 00:00:00 2001 From: "Gunung P. Wibisono" <55311527+gunungpw@users.noreply.github.com> Date: Sun, 3 Apr 2022 09:06:13 +0700 Subject: [PATCH 1/2] add example `unidiomatic-typecheck` --- doc/data/messages/u/unidiomatic-typecheck/bad.py | 3 +++ doc/data/messages/u/unidiomatic-typecheck/good.py | 3 +++ doc/data/messages/u/unidiomatic-typecheck/related.rst | 2 ++ 3 files changed, 8 insertions(+) create mode 100644 doc/data/messages/u/unidiomatic-typecheck/bad.py create mode 100644 doc/data/messages/u/unidiomatic-typecheck/good.py create mode 100644 doc/data/messages/u/unidiomatic-typecheck/related.rst diff --git a/doc/data/messages/u/unidiomatic-typecheck/bad.py b/doc/data/messages/u/unidiomatic-typecheck/bad.py new file mode 100644 index 0000000000..e1e56103d1 --- /dev/null +++ b/doc/data/messages/u/unidiomatic-typecheck/bad.py @@ -0,0 +1,3 @@ +test_score = {"Biology": 95, "History": 80} +if type(test_score) is dict: # [unidiomatic-typecheck] + pass diff --git a/doc/data/messages/u/unidiomatic-typecheck/good.py b/doc/data/messages/u/unidiomatic-typecheck/good.py new file mode 100644 index 0000000000..c50c6e4ebc --- /dev/null +++ b/doc/data/messages/u/unidiomatic-typecheck/good.py @@ -0,0 +1,3 @@ +test_score = {"Biology": 95, "History": 80} +if isinstance(test_score, dict): + pass diff --git a/doc/data/messages/u/unidiomatic-typecheck/related.rst b/doc/data/messages/u/unidiomatic-typecheck/related.rst new file mode 100644 index 0000000000..234fef1a93 --- /dev/null +++ b/doc/data/messages/u/unidiomatic-typecheck/related.rst @@ -0,0 +1,2 @@ +* `Builtin function type() `_ +* `Builtin function isinstance() `_ \ No newline at end of file From 95c6fe0143f2d644c4901693458d4ac6873be714 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 02:11:32 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- doc/data/messages/u/unidiomatic-typecheck/related.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/data/messages/u/unidiomatic-typecheck/related.rst b/doc/data/messages/u/unidiomatic-typecheck/related.rst index 234fef1a93..25b9129a70 100644 --- a/doc/data/messages/u/unidiomatic-typecheck/related.rst +++ b/doc/data/messages/u/unidiomatic-typecheck/related.rst @@ -1,2 +1,2 @@ * `Builtin function type() `_ -* `Builtin function isinstance() `_ \ No newline at end of file +* `Builtin function isinstance() `_