From 42cc5d48997ba4e29b1711decf21d26eb5271d03 Mon Sep 17 00:00:00 2001 From: ooooo <3164076421@qq.com> Date: Sun, 29 Oct 2023 14:25:53 +0800 Subject: [PATCH] enable C405 --- docs/api/gen_alias_api.py | 4 +--- docs/api/gen_doc.py | 4 ++-- pyproject.toml | 1 - 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/docs/api/gen_alias_api.py b/docs/api/gen_alias_api.py index ff1c2621a68..d267d01bc03 100644 --- a/docs/api/gen_alias_api.py +++ b/docs/api/gen_alias_api.py @@ -10,9 +10,7 @@ class AliasAPIGen: def __init__(self, paddle_root_path): self.api_dict = {} self.root_module = paddle - self.not_display_prefix = set( - ["paddle.incubate", "paddle.fluid.contrib"] - ) + self.not_display_prefix = {"paddle.incubate", "paddle.fluid.contrib"} self.id_api_dict = {} self.paddle_root_path = paddle_root_path diff --git a/docs/api/gen_doc.py b/docs/api/gen_doc.py index 3d7273a567b..708ec746c58 100755 --- a/docs/api/gen_doc.py +++ b/docs/api/gen_doc.py @@ -111,7 +111,7 @@ def insert_api_into_dict(full_name, gen_doc_anno=None): api_info_dict[fc_id]["all_names"].add(full_name) else: api_info_dict[fc_id] = { - "all_names": set([full_name]), + "all_names": {full_name}, "id": fc_id, "object": obj, "type": type(obj).__name__, @@ -952,7 +952,7 @@ def sort_name_list(api_names): """ sort and move paddle.Tensor.* to the end """ - names_sorted = sorted(list(api_names)) + names_sorted = sorted(api_names) cnt = 0 # count of paddle.Tensor.* for n in names_sorted: if n.startswith('paddle.Tensor.'): diff --git a/pyproject.toml b/pyproject.toml index e948871cd3a..31640d06e80 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -82,7 +82,6 @@ ignore = [ "W291", "PLR1722", "C403", - "C405", "C414", "C416", "C419",