File tree Expand file tree Collapse file tree 2 files changed +18
-12
lines changed Expand file tree Collapse file tree 2 files changed +18
-12
lines changed Original file line number Diff line number Diff line change 110
110
(should (equal (python-insert-docstring--get-arguments-names-from-string
111
111
" first: Type = 1,\n second: Map[some, other] = 2" ) '(" first" " second" )))
112
112
(should (equal (python-insert-docstring--get-arguments-names-from-string
113
- " first = 1,\n second = 2" ) '(" first" " second" )))))
113
+ " first = 1,\n second = 2" ) '(" first" " second" )))
114
+ (should (equal (python-insert-docstring--get-arguments-names-from-string
115
+ " self ,\n second = 2" ) '(" second" )))))
114
116
115
117
(ert-deftest prefix-lines-test ()
116
118
" Test the function to prefix lines with blanks."
Original file line number Diff line number Diff line change 147
147
" Parse the argument names contained in ARGUMENTS-STRING and return them in a list."
148
148
(if (string-equal " " arguments-string)
149
149
nil
150
- (mapcar (lambda (string )
151
- " Remove default value if any and trim"
152
- (car (split-string string " =" t python-insert-docstring-blank-or-newline-regex)))
153
- (cl-remove-if (lambda (string )
154
- " Match type data leftovers"
155
- (string-match-p (rx (or " [" " ]" ))
156
- string))
157
- (mapcar (lambda (single-argument-string )
158
- " Drop type data"
159
- (car (split-string single-argument-string " :" )))
160
- (split-string arguments-string " ," ))))))
150
+ (let ((arguments (mapcar (lambda (string )
151
+ " Remove default value if any and trim"
152
+ (car (split-string string " =" t python-insert-docstring-blank-or-newline-regex)))
153
+ (cl-remove-if (lambda (string )
154
+ " Match type data leftovers"
155
+ (string-match-p (rx (or " [" " ]" ))
156
+ string))
157
+ (mapcar (lambda (single-argument-string )
158
+ " Drop type data"
159
+ (car (split-string single-argument-string " :" )))
160
+ (split-string arguments-string " ," ))))))
161
+ (if (string-equal (car arguments)
162
+ " self" )
163
+ (cdr arguments)
164
+ arguments))))
161
165
162
166
163
167
(defun python-insert-docstring--make-function-data (indentation-string function-name argument-names )
You can’t perform that action at this time.
0 commit comments