@@ -69,15 +69,15 @@ Set option value. For example::
6969 - List
7070 - Exclude patterns in this list when search modules and packages
7171
72- Each pattern is fnmatch 格式的字符串
72+ Each pattern is matched by ` fnmatch.fnmatchcase `
7373
74- 默认情况下是匹配搜索目录下面的名称,不会匹配多级目录
74+ Each pattern only matches one level path by default
7575
76- 如果仅在某一个包中排除,使用包名称前缀模式 `pkgname:pattern `
76+ If only match files in one package, use prefix pattern `pkgname:pattern `
7777
78- 使用 `: ` 开始的模式仅用于排除工程路径下面的文件和目录
78+ If pattern starts with `: `, only match paths and files in project src
7979
80- 例如,常见的排除模式 ::
80+ For example ::
8181
8282 venv
8383 __pycache__
@@ -107,123 +107,86 @@ Set option value. For example::
107107 :widths: 20 10 10 60
108108 :header-rows: 1
109109
110- * - 选项
111- - 类型
112- - 默认值
113- - 说明
110+ * - Option
111+ - Type
112+ - Default
113+ - Remark
114114 * - rft_remove_assert
115- - 布尔
115+ - Bool
116116 - 0
117- - 是否删除脚本中 assert 语句
117+ - Remove ` assert ` statement in the script
118118 * - rft_remove_docstr
119- - 布尔
119+ - Bool
120120 - 0
121- - 是否删除脚本中所有 docstring
121+ - Remove all the docstring in the script
122122 * - rft_builtin
123- - 布尔
123+ - Bool
124124 - 0
125- - 是否重命名内置名称,例如 print 等
125+ - Rename builtin names such as ` print ` etc.
126126 * - rft_argument
127- - 枚举
128- - all
129- - 重命名参数的方式,可用值
130-
131- - 0: "no", 不重名所有函数的参数
132- - 1: "pos", 仅重命名 posonly 参数
133- - 2: "!kw",仅保留 kwonly 的参数名称,其他都重命名
134- - 3: " all", 重命名所有函数的参数(默认值)
127+ - Enum
128+ - 3
129+ - How to rename arguments in the function
130+
131+ - 0: no touch arguments
132+ - 1: only rename position-only arguments
133+ - 2: rename all the arguments except keyword-only arguments
134+ - 3: rename all the arguments
135135 * - rft_auto_export
136- - 布尔
136+ - Bool
137137 - 0
138- - 是否输出模块属性 `__all__ ` 中列出的名称
138+ - Export all the names list in the module attribute `__all__ `
139139
140- 输出的名称在重构过程中不会被重命名
141-
142- 如果输出的名称是类,那么类的方法和属性也不会重命名
143-
144- 如果输出的名称是函数,那么函数的参数也不会重命名
145-
146- 模块 ``__all__ `` 的名称可能是模块内部定义的,也可能是导入的名称
147-
148- 如果是导入的名称,在被导入的模块中也不会重命名该名称
140+ Exported names won't be renamed
149141 * - rft_exclude_names
150- - 模式列表
142+ - List
151143 -
152- - 列出不能重命名的模块,函数,类,方法,属性
144+ - List all exported function, class, attributes
153145
154- 支持的格式如下::
146+ No rename them when reforming the scripts
155147
156- "name" 所有模块中的函数,方法,类,属性
157- "cls.name" 所有模块中指定类的方法和属性
148+ The support formats::
158149
159- "modname: name" 限制在指定模块内部
160- "modname: cls.name"
150+ "name"
151+ "cls.name"
161152
162- "modname:*" 不重命名指定模块的所有类和方法
163- "^ name" 限定名称在模块层
153+ "modname:name"
154+ "modname:cls. name"
164155
165- 这里面列出的名称仅对模块内部定义的名称有效,对于导入的名称无效
156+ "modname:*"
157+ "^name"
166158
167- 参数和局部变量总是会被重命名,这里列出的名称对参数和局部变量不起作用
159+ Note that arguments and local variables are always renamed
168160 * - rft_exclude_args
169- - 模式列表
161+ - List
170162 -
171- - 这里面列出的函数名称,对应的参数都不进行重命名::
163+ - List all the functions which arguments can't be reformed
164+
165+ The support formats::
172166
173167 "func"
174168 "modname:func"
175169 "modname:cls.method"
176-
177- 以 "!" 开头的模式表示该函数的参数依旧会进行重命名,例如::
178-
179- "!func"
180- "!modname:func"
181- "!modname:cls.method"
182-
183- 主要是为了不在警告信息中显示该函数,否则总是在日志中显示警告
184170 * - extra_builtins
185- - 名称列表
171+ - List
186172 -
187- - 除了 builtins 模块之外,需要作为内置名称进行处理的额外名称
173+ - Extra builtin name
188174 * - var_type_table
189- - 列表
175+ - List
190176 -
191- - 多行列表,每一行对应一个变量类型,支持的格式如下::
177+ - Define type for variable
178+
179+ The support formats::
192180
193181 modname:func.var typename
194182 modname:cls.method.var typename
195183
196- 如果变量是属于 For/With/Except/Comprehension 中的变量,那么 ::
184+ If this variable is defined in For/With/Except/Comprehension, then use this format ::
197185
198186 {modname:func.var} typename
199187
200- typename 支持的格式:
201-
202- - "cls" 当前模块中定义的类名称
203- - "modname:cls" 在其它模块中定义的类名称
204- - "<any>" 内置类型名称,该变量的所有属性都不会进行重命名
205- * - extra_type_info
206- - 列表
207- -
208- - 较少使用,用来指定已知类型的额外属性信息,包括额外的属性::
209-
210- modname:cls attrname1:typename attrname2:typename
211-
212- 指定已知属性的返回类型::
213-
214- modname:cls (method1):typename (method2):typename
215-
216- 指定已知属性的子元素类型,例如::
217-
218- modname:cls [attrname1]:typename1,typename2
219-
220- * - on_unknown_attr
221- - 枚举
222- - log
223- - 遇到不知道如何处理的属性链的处理方式:
188+ The formats of typename:
224189
225- - "ask" 询问用户进行处理
226- - "log" 记录到日志(默认选项)
227- - "yes" 直接重命名
228- - "no" 不重名,也不记录到日志
229- - "err" 报错退出
190+ - "cls": The class name in same module
191+ - "modname:cls": The module name and class name
192+ - "<any>": Any builtin type
0 commit comments