forked from edreamleo/make-stub-files
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.cfg
85 lines (65 loc) · 2.49 KB
/
example.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# An example configuration file for make_stub_files.py.
# By default, make_stub_files.py uses ~/stubs/make_stub_files.cfg.
# Can be changed using the --config=path command-line option.
[Global]
files:
# Files to be used *only* if no files are given on the command line.
# glob.glob wildcards are supported.
output_directory: ~/stubs
prefix_lines:
# Lines to be inserted at the start of each stub file.
from typing import TypeVar
T = TypeVar('T', int, float, complex)
# Notes about patterns used below:
#
# **Balanced patterns** contain either (*), [*], or {*}.
# Unlike regular expressions, balanced patterns match only balanced brackets.
#
# Both regex and balanced patterns may appear in each section.
# However, balanced patterns will never match argument names.
#
# Patterns are matched in the order they appear in each section,
# but the .* pattern (if present) will match last, regardless of its
# position in the section.
[Def Name Patterns]
# These regex patterns give the return types of functions or methods.
#
# Patterns for methods should match class_name.method_name.
#
# Patterns in this section *override* all other patterns,
# so you should use these patterns only if:
#
# - No other pattern properly handles the function or method, or
#
# - The pattern specifies functions that should all return the same value.
# For example, all ast tree traversers should have the same signatures.
#
# It may be unwise to use .* in this section, but the choice is yours.
[Argument Patterns]
# The regex patterns in this section apply only when assigning types
# to *arguments* to functions or methods. Patterns match argument names.
# Typically, most patterns can be put [General Patterns] section instead.
[General Patterns]
# The patterns in this section may be either regex or balanced patterns.
# Patterns in this section are applied both to arguments and return expressions.
# These patterns are applied *once* to argument names and *repeatedly* to
# return types until no further matches can be made.
aList[1-3]?: Sequence
i: int
j: int
k: int
node: ast.Ast
s[1-3]?: str
[Return Patterns]
# The patterns in this section may be either regex or balanced patterns.
# Patterns in this section are applied only to return expressions.
# These patterns are applied *repeatedly* to return expressions
# until no further matches can be made.
# Balanced patterns...
repr(*): str
str.join(*): str
str.replace(*): str
str%(*): str
str%str: str
# Regex patterns...
.*__name__: str