emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/treesit-fold 0d884a4217 224/417: refactor(checkdoc): Fix c


From: ELPA Syncer
Subject: [nongnu] elpa/treesit-fold 0d884a4217 224/417: refactor(checkdoc): Fix checkdoc warnings (#23)
Date: Mon, 1 Jul 2024 10:02:28 -0400 (EDT)

branch: elpa/treesit-fold
commit 0d884a4217fcda675a6bc5838e003b0fb675c556
Author: Jen-Chieh Shen <jcs090218@gmail.com>
Commit: GitHub <noreply@github.com>

    refactor(checkdoc): Fix checkdoc warnings (#23)
    
    * refactor(checkdoc): Fix checkdoc warnings
    
    * add lint and checkdoc
---
 Makefile              |  2 +-
 ts-fold-indicators.el |  6 ++++--
 ts-fold-parsers.el    | 42 +++++++++++++++++++++---------------------
 ts-fold-summary.el    |  6 +++---
 ts-fold.el            | 30 ++++++++++++++++++++++++------
 5 files changed, 53 insertions(+), 33 deletions(-)

diff --git a/Makefile b/Makefile
index bf0ccecd64..779e7ff196 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@ EASK ?= eask
 
 .PHONY: clean checkdoc lint package install compile test
 
-ci: clean package install compile test
+ci: clean package install compile test lint checkdoc
 
 package:
        @echo "Packaging..."
diff --git a/ts-fold-indicators.el b/ts-fold-indicators.el
index c5d57730bc..36a72d4673 100644
--- a/ts-fold-indicators.el
+++ b/ts-fold-indicators.el
@@ -213,7 +213,9 @@ head (first line) of the region."
         (t nil)))))
 
 (defun ts-fold-indicators--active-ov (folded ov bitmap)
-  "SHOW the indicator OV with BITMAP."
+  "SHOW the indicator OV with BITMAP.
+
+Argument FOLDED holds folding state; it's a boolean."
   (when (overlayp ov)
     (overlay-put ov 'ts-fold-indicators-active folded)
     (overlay-put ov 'type bitmap)
@@ -228,7 +230,7 @@ head (first line) of the region."
     (t (user-error "Invalid indicators fringe type: %s" 
ts-fold-indicators-fringe))))
 
 (defun ts-fold-indicators--update-overlays (ov-lst folded)
-  "SHOW indicators overlays OV-LST."
+  "SHOW indicators overlays OV-LST depends on FOLDED."
   (when-let* ((len (length ov-lst))
               ((> len 1))
               (len-1 (1- len))
diff --git a/ts-fold-parsers.el b/ts-fold-parsers.el
index 668bb772a9..d8f837528f 100644
--- a/ts-fold-parsers.el
+++ b/ts-fold-parsers.el
@@ -57,11 +57,11 @@
 ;; TODO(everyone): keep the function alphabetically sorted
 
 (defun ts-fold-parsers-agda ()
-  "Rule sets for Agda."
+  "Rule set for Agda."
   '(()))
 
 (defun ts-fold-parsers-bash ()
-  "Rule sets for Bash."
+  "Rule set for Bash."
   '((compound_statement . ts-fold-range-seq)
     (expansion          . ts-fold-range-seq)
     (comment
@@ -69,7 +69,7 @@
          (ts-fold-range-line-comment node offset "#")))))
 
 (defun ts-fold-parsers-c ()
-  "Rule sets for C."
+  "Rule set for C."
   '((compound_statement     . ts-fold-range-seq)
     (declaration_list       . ts-fold-range-seq)
     (enumerator_list        . ts-fold-range-seq)
@@ -81,11 +81,11 @@
     (comment                . ts-fold-range-c-like-comment)))
 
 (defun ts-fold-parsers-c++ ()
-  "Rule sets for C++."
+  "Rule set for C++."
   (append (ts-fold-parsers-c)))
 
 (defun ts-fold-parsers-csharp ()
-  "Rule sets for C#."
+  "Rule set for C#."
   '((block                                . ts-fold-range-seq)
     (accessor_list                        . ts-fold-range-seq)
     (enum_member_declaration_list         . ts-fold-range-seq)
@@ -102,13 +102,13 @@
     (comment                              . ts-fold-range-c-like-comment)))
 
 (defun ts-fold-parsers-css ()
-  "Rule sets for CSS."
+  "Rule set for CSS."
   '((keyframe_block_list . ts-fold-range-seq)
     (block               . ts-fold-range-seq)
     (comment             . ts-fold-range-c-like-comment)))
 
 (defun ts-fold-parsers-elixir ()
-  "Rules sets for Elixir."
+  "Rules set for Elixir."
   '((list . ts-fold-range-seq)
     (map . ts-fold-range-seq)
     (tuple . ts-fold-range-seq)
@@ -118,17 +118,17 @@
     (do_block . ts-fold-range-elixir)))
 
 (defun ts-fold-parsers-go ()
-  "Rule sets for Go."
+  "Rule set for Go."
   '((block   . ts-fold-range-seq)
     (comment . ts-fold-range-seq)))
 
 (defun ts-fold-parsers-html ()
-  "Rule sets for HTML."
+  "Rule set for HTML."
   '((element . ts-fold-range-html)
     (comment . (ts-fold-range-seq 1 -1))))
 
 (defun ts-fold-parsers-java ()
-  "Rule sets for Java."
+  "Rule set for Java."
   '((switch_block                    . ts-fold-range-seq)
     (block                           . ts-fold-range-seq)
     (element_value_array_initializer . ts-fold-range-seq)
@@ -142,24 +142,24 @@
     (comment                         . (ts-fold-range-seq 1 -1))))
 
 (defun ts-fold-parsers-javascript ()
-  "Rule sets for JavaScript."
+  "Rule set for JavaScript."
   '((export_clause   . ts-fold-range-seq)
     (statement_block . ts-fold-range-seq)
     (comment         . ts-fold-range-c-like-comment)))
 
 (defun ts-fold-parsers-json ()
-  "Rule sets for JSON."
+  "Rule set for JSON."
   '((object . ts-fold-range-seq)
     (array  . ts-fold-range-seq)))
 
 (defun ts-fold-parsers-nix ()
-  "Rule sets for Nix."
+  "Rule set for Nix."
   '((attrset       . ts-fold-range-seq)
     (interpolation . ts-fold-range-seq)
     (list          . ts-fold-range-seq)))
 
 (defun ts-fold-parsers-php ()
-  "Rule sets for PHP."
+  "Rule set for PHP."
   '((namespace_use_group . ts-fold-range-seq)
     (declaration_list    . ts-fold-range-seq)
     (use_list            . ts-fold-range-seq)
@@ -172,7 +172,7 @@
            (ts-fold-range-c-like-comment node offset))))))
 
 (defun ts-fold-parsers-python ()
-  "Rule sets for Python."
+  "Rule set for Python."
   '((function_definition . ts-fold-range-python)
     (class_definition    . ts-fold-range-python)
     (list                . ts-fold-range-seq)
@@ -181,11 +181,11 @@
          (ts-fold-range-line-comment node offset "#")))))
 
 (defun ts-fold-parsers-r ()
-  "Rule sets for R."
+  "Rule set for R."
   '((brace_list . ts-fold-range-seq)))
 
 (defun ts-fold-parsers-ruby ()
-  "Rule sets for Ruby."
+  "Rule set for Ruby."
   '((class  . ts-fold-range-ruby)
     (method . ts-fold-range-ruby)
     (array  . ts-fold-range-seq)
@@ -194,7 +194,7 @@
          (ts-fold-range-line-comment node offset "#")))))
 
 (defun ts-fold-parsers-rust ()
-  "Rule sets for Rust."
+  "Rule set for Rust."
   '((declaration_list       . ts-fold-range-seq)
     (enum_variant_list      . ts-fold-range-seq)
     (field_declaration_list . ts-fold-range-seq)
@@ -208,14 +208,14 @@
     (block_comment          . ts-fold-range-block-comment)))
 
 (defun ts-fold-parsers-scala ()
-  "Rule sets for Scala."
+  "Rule set for Scala."
   '((import_selectors . ts-fold-range-seq)
     (template_body    . ts-fold-range-seq)
     (block            . ts-fold-range-seq)
     (comment          . ts-fold-range-c-like-comment)))
 
 (defun ts-fold-parsers-swift ()
-  "Rule sets for Swift."
+  "Rule set for Swift."
   '((switch_statement      . ts-fold-range-seq)
     (function_declaration  . ts-fold-range-seq)
     (enum_declaration      . ts-fold-range-seq)
@@ -226,7 +226,7 @@
     (comment               . ts-fold-range-c-like-comment)))
 
 (defun ts-fold-parsers-typescript ()
-  "Rule sets for TypeScript."
+  "Rule set for TypeScript."
   (append (ts-fold-parsers-javascript)))
 
 (provide 'ts-fold-parsers)
diff --git a/ts-fold-summary.el b/ts-fold-summary.el
index 28db7f5192..35be90df75 100644
--- a/ts-fold-summary.el
+++ b/ts-fold-summary.el
@@ -75,7 +75,7 @@ type of content by checking the word boundary's existence."
   line)
 
 (defun ts-fold-summary--extract-summary (doc-str sym)
-  "Extract only document summary from DOC-STR using SYM"
+  "Extract only document summary from DOC-STR using SYM."
   (let ((lines (split-string doc-str "\n")) new-lines)
     (dolist (line lines)
       (setq line (string-trim line))
@@ -86,7 +86,7 @@ type of content by checking the word boundary's existence."
     (reverse new-lines)))
 
 (defun ts-fold-summary--doc-extract (doc-str sym)
-  "Default way to extract the doc summary from DOC-STR."
+  "Default way to extract the doc summary from DOC-STR using SYM."
   (let* ((lines (ts-fold-summary--extract-summary doc-str sym)) (summary (nth 
0 lines)))
     (when summary (setq summary (string-trim summary)))
     (if (string-empty-p summary) nil summary)))
@@ -223,7 +223,7 @@ type of content by checking the word boundary's existence."
     (swift-mode        . ts-fold-summary-c)
     (typescript-mode   . ts-fold-summary-javadoc)
     (nxml-mode         . ts-fold-summary-xml))
-  "Alist mapping major-mode to doc parser function."
+  "Alist mapping `major-mode' to doc parser function."
   :type 'hook
   :group 'ts-fold)
 
diff --git a/ts-fold.el b/ts-fold.el
index 7d47842830..edab17dac7 100644
--- a/ts-fold.el
+++ b/ts-fold.el
@@ -395,7 +395,10 @@ more information."
   (ts-fold-range-seq node (ts-fold--cons-add '(1 . -1) offset)))
 
 (defun ts-fold-range-c-like-comment (node offset)
-  "Define fold range for C-like comemnt."
+  "Define fold range for C-like comemnt.
+
+For arguments NODE and OFFSET, see function `ts-fold-range-seq' for
+more information."
   (let ((text (tsc-node-text node)))
     (if (and (string-match-p "\n" text) (string-prefix-p "/*" text))
         (ts-fold-range-block-comment node offset)
@@ -408,7 +411,10 @@ more information."
 ;;
 
 (defun ts-fold-range-c-preproc-if (node offset)
-  "Define fold range for `if' preprocessor."
+  "Define fold range for `if' preprocessor.
+
+For arguments NODE and OFFSET, see function `ts-fold-range-seq' for
+more information."
   (let* ((named-node (tsc-get-child-by-field node :condition))
          (else (tsc-get-child-by-field node :alternative))
          (beg (tsc-node-end-position named-node))
@@ -416,7 +422,10 @@ more information."
     (ts-fold--cons-add (cons beg end) offset)))
 
 (defun ts-fold-range-c-preproc-ifdef (node offset)
-  "Define fold range for `ifdef' and `ifndef' preprocessor."
+  "Define fold range for `ifdef' and `ifndef' preprocessor.
+
+For arguments NODE and OFFSET, see function `ts-fold-range-seq' for
+more information."
   (when-let* ((named-node (tsc-get-child-by-field node :name))
               (else (tsc-get-child-by-field node :alternative))
               (beg (tsc-node-end-position named-node))
@@ -424,7 +433,10 @@ more information."
     (ts-fold--cons-add (cons beg end) offset)))
 
 (defun ts-fold-range-c-preproc-elif (node offset)
-  "Define fold range for `elif' preprocessor."
+  "Define fold range for `elif' preprocessor.
+
+For arguments NODE and OFFSET, see function `ts-fold-range-seq' for
+more information."
   (when-let* ((named-node (tsc-get-child-by-field node :condition))
               (else (tsc-get-child-by-field node :alternative))
               (beg (tsc-node-end-position named-node))
@@ -432,7 +444,10 @@ more information."
     (ts-fold--cons-add (cons beg end) offset)))
 
 (defun ts-fold-range-c-preproc-else (node offset)
-  "Define fold range for `else' preprocessor."
+  "Define fold range for `else' preprocessor.
+
+For arguments NODE and OFFSET, see function `ts-fold-range-seq' for
+more information."
   (when-let* ((target "#else")
               (len (length target))
               (beg (+ (tsc-node-start-position node) len))
@@ -440,7 +455,10 @@ more information."
     (ts-fold--cons-add (cons beg end) offset)))
 
 (defun ts-fold-range-html (node offset)
-  "Define fold range for tag in HTML."
+  "Define fold range for tag in HTML.
+
+For arguments NODE and OFFSET, see function `ts-fold-range-seq' for
+more information."
   (let* ((beg (tsc-node-end-position (tsc-get-nth-child node 0)))
          (end-node (tsc-get-nth-child node (1- (tsc-count-children node))))
          (end (tsc-node-start-position end-node)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]