Skip to content

Commit 0d884a4

Browse files
authored
refactor(checkdoc): Fix checkdoc warnings (#23)
* refactor(checkdoc): Fix checkdoc warnings * add lint and checkdoc
1 parent 401aad7 commit 0d884a4

File tree

5 files changed

+53
-33
lines changed

5 files changed

+53
-33
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ EASK ?= eask
33

44
.PHONY: clean checkdoc lint package install compile test
55

6-
ci: clean package install compile test
6+
ci: clean package install compile test lint checkdoc
77

88
package:
99
@echo "Packaging..."

ts-fold-indicators.el

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,9 @@ head (first line) of the region."
213213
(t nil)))))
214214

215215
(defun ts-fold-indicators--active-ov (folded ov bitmap)
216-
"SHOW the indicator OV with BITMAP."
216+
"SHOW the indicator OV with BITMAP.
217+
218+
Argument FOLDED holds folding state; it's a boolean."
217219
(when (overlayp ov)
218220
(overlay-put ov 'ts-fold-indicators-active folded)
219221
(overlay-put ov 'type bitmap)
@@ -228,7 +230,7 @@ head (first line) of the region."
228230
(t (user-error "Invalid indicators fringe type: %s" ts-fold-indicators-fringe))))
229231

230232
(defun ts-fold-indicators--update-overlays (ov-lst folded)
231-
"SHOW indicators overlays OV-LST."
233+
"SHOW indicators overlays OV-LST depends on FOLDED."
232234
(when-let* ((len (length ov-lst))
233235
((> len 1))
234236
(len-1 (1- len))

ts-fold-parsers.el

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,19 @@
5757
;; TODO(everyone): keep the function alphabetically sorted
5858

5959
(defun ts-fold-parsers-agda ()
60-
"Rule sets for Agda."
60+
"Rule set for Agda."
6161
'(()))
6262

6363
(defun ts-fold-parsers-bash ()
64-
"Rule sets for Bash."
64+
"Rule set for Bash."
6565
'((compound_statement . ts-fold-range-seq)
6666
(expansion . ts-fold-range-seq)
6767
(comment
6868
. (lambda (node offset)
6969
(ts-fold-range-line-comment node offset "#")))))
7070

7171
(defun ts-fold-parsers-c ()
72-
"Rule sets for C."
72+
"Rule set for C."
7373
'((compound_statement . ts-fold-range-seq)
7474
(declaration_list . ts-fold-range-seq)
7575
(enumerator_list . ts-fold-range-seq)
@@ -81,11 +81,11 @@
8181
(comment . ts-fold-range-c-like-comment)))
8282

8383
(defun ts-fold-parsers-c++ ()
84-
"Rule sets for C++."
84+
"Rule set for C++."
8585
(append (ts-fold-parsers-c)))
8686

8787
(defun ts-fold-parsers-csharp ()
88-
"Rule sets for C#."
88+
"Rule set for C#."
8989
'((block . ts-fold-range-seq)
9090
(accessor_list . ts-fold-range-seq)
9191
(enum_member_declaration_list . ts-fold-range-seq)
@@ -102,13 +102,13 @@
102102
(comment . ts-fold-range-c-like-comment)))
103103

104104
(defun ts-fold-parsers-css ()
105-
"Rule sets for CSS."
105+
"Rule set for CSS."
106106
'((keyframe_block_list . ts-fold-range-seq)
107107
(block . ts-fold-range-seq)
108108
(comment . ts-fold-range-c-like-comment)))
109109

110110
(defun ts-fold-parsers-elixir ()
111-
"Rules sets for Elixir."
111+
"Rules set for Elixir."
112112
'((list . ts-fold-range-seq)
113113
(map . ts-fold-range-seq)
114114
(tuple . ts-fold-range-seq)
@@ -118,17 +118,17 @@
118118
(do_block . ts-fold-range-elixir)))
119119

120120
(defun ts-fold-parsers-go ()
121-
"Rule sets for Go."
121+
"Rule set for Go."
122122
'((block . ts-fold-range-seq)
123123
(comment . ts-fold-range-seq)))
124124

125125
(defun ts-fold-parsers-html ()
126-
"Rule sets for HTML."
126+
"Rule set for HTML."
127127
'((element . ts-fold-range-html)
128128
(comment . (ts-fold-range-seq 1 -1))))
129129

130130
(defun ts-fold-parsers-java ()
131-
"Rule sets for Java."
131+
"Rule set for Java."
132132
'((switch_block . ts-fold-range-seq)
133133
(block . ts-fold-range-seq)
134134
(element_value_array_initializer . ts-fold-range-seq)
@@ -142,24 +142,24 @@
142142
(comment . (ts-fold-range-seq 1 -1))))
143143

144144
(defun ts-fold-parsers-javascript ()
145-
"Rule sets for JavaScript."
145+
"Rule set for JavaScript."
146146
'((export_clause . ts-fold-range-seq)
147147
(statement_block . ts-fold-range-seq)
148148
(comment . ts-fold-range-c-like-comment)))
149149

150150
(defun ts-fold-parsers-json ()
151-
"Rule sets for JSON."
151+
"Rule set for JSON."
152152
'((object . ts-fold-range-seq)
153153
(array . ts-fold-range-seq)))
154154

155155
(defun ts-fold-parsers-nix ()
156-
"Rule sets for Nix."
156+
"Rule set for Nix."
157157
'((attrset . ts-fold-range-seq)
158158
(interpolation . ts-fold-range-seq)
159159
(list . ts-fold-range-seq)))
160160

161161
(defun ts-fold-parsers-php ()
162-
"Rule sets for PHP."
162+
"Rule set for PHP."
163163
'((namespace_use_group . ts-fold-range-seq)
164164
(declaration_list . ts-fold-range-seq)
165165
(use_list . ts-fold-range-seq)
@@ -172,7 +172,7 @@
172172
(ts-fold-range-c-like-comment node offset))))))
173173

174174
(defun ts-fold-parsers-python ()
175-
"Rule sets for Python."
175+
"Rule set for Python."
176176
'((function_definition . ts-fold-range-python)
177177
(class_definition . ts-fold-range-python)
178178
(list . ts-fold-range-seq)
@@ -181,11 +181,11 @@
181181
(ts-fold-range-line-comment node offset "#")))))
182182

183183
(defun ts-fold-parsers-r ()
184-
"Rule sets for R."
184+
"Rule set for R."
185185
'((brace_list . ts-fold-range-seq)))
186186

187187
(defun ts-fold-parsers-ruby ()
188-
"Rule sets for Ruby."
188+
"Rule set for Ruby."
189189
'((class . ts-fold-range-ruby)
190190
(method . ts-fold-range-ruby)
191191
(array . ts-fold-range-seq)
@@ -194,7 +194,7 @@
194194
(ts-fold-range-line-comment node offset "#")))))
195195

196196
(defun ts-fold-parsers-rust ()
197-
"Rule sets for Rust."
197+
"Rule set for Rust."
198198
'((declaration_list . ts-fold-range-seq)
199199
(enum_variant_list . ts-fold-range-seq)
200200
(field_declaration_list . ts-fold-range-seq)
@@ -208,14 +208,14 @@
208208
(block_comment . ts-fold-range-block-comment)))
209209

210210
(defun ts-fold-parsers-scala ()
211-
"Rule sets for Scala."
211+
"Rule set for Scala."
212212
'((import_selectors . ts-fold-range-seq)
213213
(template_body . ts-fold-range-seq)
214214
(block . ts-fold-range-seq)
215215
(comment . ts-fold-range-c-like-comment)))
216216

217217
(defun ts-fold-parsers-swift ()
218-
"Rule sets for Swift."
218+
"Rule set for Swift."
219219
'((switch_statement . ts-fold-range-seq)
220220
(function_declaration . ts-fold-range-seq)
221221
(enum_declaration . ts-fold-range-seq)
@@ -226,7 +226,7 @@
226226
(comment . ts-fold-range-c-like-comment)))
227227

228228
(defun ts-fold-parsers-typescript ()
229-
"Rule sets for TypeScript."
229+
"Rule set for TypeScript."
230230
(append (ts-fold-parsers-javascript)))
231231

232232
(provide 'ts-fold-parsers)

ts-fold-summary.el

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ type of content by checking the word boundary's existence."
7575
line)
7676

7777
(defun ts-fold-summary--extract-summary (doc-str sym)
78-
"Extract only document summary from DOC-STR using SYM"
78+
"Extract only document summary from DOC-STR using SYM."
7979
(let ((lines (split-string doc-str "\n")) new-lines)
8080
(dolist (line lines)
8181
(setq line (string-trim line))
@@ -86,7 +86,7 @@ type of content by checking the word boundary's existence."
8686
(reverse new-lines)))
8787

8888
(defun ts-fold-summary--doc-extract (doc-str sym)
89-
"Default way to extract the doc summary from DOC-STR."
89+
"Default way to extract the doc summary from DOC-STR using SYM."
9090
(let* ((lines (ts-fold-summary--extract-summary doc-str sym)) (summary (nth 0 lines)))
9191
(when summary (setq summary (string-trim summary)))
9292
(if (string-empty-p summary) nil summary)))
@@ -223,7 +223,7 @@ type of content by checking the word boundary's existence."
223223
(swift-mode . ts-fold-summary-c)
224224
(typescript-mode . ts-fold-summary-javadoc)
225225
(nxml-mode . ts-fold-summary-xml))
226-
"Alist mapping major-mode to doc parser function."
226+
"Alist mapping `major-mode' to doc parser function."
227227
:type 'hook
228228
:group 'ts-fold)
229229

ts-fold.el

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,10 @@ more information."
395395
(ts-fold-range-seq node (ts-fold--cons-add '(1 . -1) offset)))
396396

397397
(defun ts-fold-range-c-like-comment (node offset)
398-
"Define fold range for C-like comemnt."
398+
"Define fold range for C-like comemnt.
399+
400+
For arguments NODE and OFFSET, see function `ts-fold-range-seq' for
401+
more information."
399402
(let ((text (tsc-node-text node)))
400403
(if (and (string-match-p "\n" text) (string-prefix-p "/*" text))
401404
(ts-fold-range-block-comment node offset)
@@ -408,39 +411,54 @@ more information."
408411
;;
409412

410413
(defun ts-fold-range-c-preproc-if (node offset)
411-
"Define fold range for `if' preprocessor."
414+
"Define fold range for `if' preprocessor.
415+
416+
For arguments NODE and OFFSET, see function `ts-fold-range-seq' for
417+
more information."
412418
(let* ((named-node (tsc-get-child-by-field node :condition))
413419
(else (tsc-get-child-by-field node :alternative))
414420
(beg (tsc-node-end-position named-node))
415421
(end (1- (tsc-node-start-position else))))
416422
(ts-fold--cons-add (cons beg end) offset)))
417423

418424
(defun ts-fold-range-c-preproc-ifdef (node offset)
419-
"Define fold range for `ifdef' and `ifndef' preprocessor."
425+
"Define fold range for `ifdef' and `ifndef' preprocessor.
426+
427+
For arguments NODE and OFFSET, see function `ts-fold-range-seq' for
428+
more information."
420429
(when-let* ((named-node (tsc-get-child-by-field node :name))
421430
(else (tsc-get-child-by-field node :alternative))
422431
(beg (tsc-node-end-position named-node))
423432
(end (1- (tsc-node-start-position else))))
424433
(ts-fold--cons-add (cons beg end) offset)))
425434

426435
(defun ts-fold-range-c-preproc-elif (node offset)
427-
"Define fold range for `elif' preprocessor."
436+
"Define fold range for `elif' preprocessor.
437+
438+
For arguments NODE and OFFSET, see function `ts-fold-range-seq' for
439+
more information."
428440
(when-let* ((named-node (tsc-get-child-by-field node :condition))
429441
(else (tsc-get-child-by-field node :alternative))
430442
(beg (tsc-node-end-position named-node))
431443
(end (1- (tsc-node-start-position else))))
432444
(ts-fold--cons-add (cons beg end) offset)))
433445

434446
(defun ts-fold-range-c-preproc-else (node offset)
435-
"Define fold range for `else' preprocessor."
447+
"Define fold range for `else' preprocessor.
448+
449+
For arguments NODE and OFFSET, see function `ts-fold-range-seq' for
450+
more information."
436451
(when-let* ((target "#else")
437452
(len (length target))
438453
(beg (+ (tsc-node-start-position node) len))
439454
(end (tsc-node-end-position node)))
440455
(ts-fold--cons-add (cons beg end) offset)))
441456

442457
(defun ts-fold-range-html (node offset)
443-
"Define fold range for tag in HTML."
458+
"Define fold range for tag in HTML.
459+
460+
For arguments NODE and OFFSET, see function `ts-fold-range-seq' for
461+
more information."
444462
(let* ((beg (tsc-node-end-position (tsc-get-nth-child node 0)))
445463
(end-node (tsc-get-nth-child node (1- (tsc-count-children node))))
446464
(end (tsc-node-start-position end-node)))

0 commit comments

Comments
 (0)