{"id":13862005,"url":"https://github.com/cyrus-and/comb","last_synced_at":"2025-04-30T08:59:26.486Z","repository":{"id":66185119,"uuid":"144396171","full_name":"cyrus-and/comb","owner":"cyrus-and","description":"Interactive code auditing and grep tool in Emacs Lisp","archived":false,"fork":false,"pushed_at":"2020-10-10T11:48:06.000Z","size":102,"stargazers_count":76,"open_issues_count":1,"forks_count":9,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-02-25T06:23:07.534Z","etag":null,"topics":["emacs","emacs-lisp","find","grep","static-analysis"],"latest_commit_sha":null,"homepage":"","language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cyrus-and.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-08-11T15:24:28.000Z","updated_at":"2024-11-11T21:06:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"91da17a8-2348-41c4-b502-1ee2d7684146","html_url":"https://github.com/cyrus-and/comb","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyrus-and%2Fcomb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyrus-and%2Fcomb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyrus-and%2Fcomb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyrus-and%2Fcomb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cyrus-and","download_url":"https://codeload.github.com/cyrus-and/comb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242619122,"owners_count":20159001,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["emacs","emacs-lisp","find","grep","static-analysis"],"created_at":"2024-08-05T06:01:34.677Z","updated_at":"2025-03-08T22:31:05.531Z","avatar_url":"https://github.com/cyrus-and.png","language":"Emacs Lisp","funding_links":[],"categories":["Emacs Lisp"],"sub_categories":[],"readme":"[![MELPA Stable](https://stable.melpa.org/packages/comb-badge.svg)](https://stable.melpa.org/#/comb)\n[![MELPA](https://melpa.org/packages/comb-badge.svg)](https://melpa.org/#/comb)\n\n# Comb\n\nComb is a native Emacs Lisp solution to search, browse and annotate occurrences\nof regular expressions in files. The interactive interface allows to perform an\nexhaustive classification of all the results to rule out false positives and\nasses proper matches during code audit.\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://i.imgur.com/13toxVQ.png\" width=\"804px\" alt=\"Browse\"/\u003e\u003c/p\u003e\n\n## Installation\n\n### [MELPA] package\n\n```\nM-x package-install RET comb\n```\n\n[MELPA]: https://melpa.org/#/getting-started\n\n### Local package\n\n```\nM-x package-install-file RET /path/to/comb/\n```\n\n### Manual\n\n```elisp\n(add-to-list 'load-path \"/path/to/comb/\")\n(require 'comb)\n```\n\n## Usage\n\nThis is a quick walkthrough of some of the features of Comb. To perform a\nsearch:\n\n1. move to the root directory of the repository you want to audit;\n\n2. run `M-x comb`;\n\n3. press `c` to enter the configuration mode;\n\n4. fill the desired fields and finally perform a search.\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://i.imgur.com/xRrx5at.png\" width=\"628px\" alt=\"Configure\"/\u003e\u003c/p\u003e\n\nIf there are some results to browse then the `*Comb*` buffer is displayed, from\nhere it is possible to annotate the results (`!`) and change their status to\napproved (`a`/`A`), rejected (`r`/`R`) or undecided (`u`/`U`, the default).\n\nThe above actions work on the current result which can be moved to the next\n(`n`) or the previous (`p`), in doing so the `*Comb*` buffer is updated to show\nthe file that contains the result, which is now highlighted. Only results\nmatching the status filter (cycled with `f`) and the notes filter regexp (set\nwith `F`) are displayed. In addition to that, `t` spawns a buffer containing the\nlist of the currently displayed results, this allows to Isearch the snippets and\njump to the result at point.\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://i.imgur.com/KddKKrQ.png\" width=\"628px\" alt=\"Report\"/\u003e\u003c/p\u003e\n\nFinally it is possible to save the current session to file (`s`) and load it\nback to resume the audit (`l`).\n\nSee the help (`h`) for a list of all the features and keybindings.\n\n### Regexps\n\nThe patterns used by Comb are Emacs-flavored regexps (see the [`(elisp) Regular\nExpressions`][info-regexp] info node). The `M-x regexp-builder` utility can be\nused to interactively try the regexps before performing a search, just make sure\nto use the proper syntax (`C-c TAB string`) and leave out the surrounding `\"`.\n\n[info-regexp]: https://www.gnu.org/software/emacs/manual/html_node/elisp/Regular-Expressions.html\n\n### Callbacks\n\nComb also accepts a list of callbacks that can be used to generate additional\nsearch results, e.g., coming from an external linting tool. These functions are\nexecuted with the `default-directory` set to the root directory and the current\nbuffer set to the currently processed file, they accept a relative path as an\nargument and must return a list of ranges in the form `(BEGIN . END)`.\n\nHere is an example callback:\n\n```elisp\n(defun my-callback (filename)\n  \"Match only the first occurrence of 'qwerty'.\"\n  (when (re-search-forward \"qwerty\" nil t)\n    (list (cons (match-beginning 0) (match-end 0)))))\n```\n\nErrors in the callback execution are not fatal, they are just reported in the\n`*Messages*` buffer.\n\n## Configuration\n\nSome faces and options can be configured, take a look at the `comb`\ncustomization group (`M-x customize-group RET comb`).\n\nAdditionally, all the keybindings in the `*Comb*` buffer can be altered by\nchanging the `comb-keymap` keymap. For example, to use the arrows to navigate\nthe results use:\n\n```elisp\n(define-key comb-keymap (kbd \"\u003cleft\u003e\") 'comb-prev)\n(define-key comb-keymap (kbd \"\u003cright\u003e\") 'comb-next)\n```\n\nThis does not unbind the original keybindings though. It may be convenient to\ncompletely replace the keymap instead so to avoid collisions with existing\nmodes:\n\n```elisp\n(setq comb-keymap (make-sparse-keymap))\n(define-key comb-keymap (kbd \"x\") 'comb-quit)\n(define-key comb-keymap (kbd \"?\") 'comb-help)\n(define-key comb-keymap (kbd \"\u003cleft\u003e\") 'comb-prev)\n(define-key comb-keymap (kbd \"\u003cright\u003e\") 'comb-next)\n;; ...\n```\n\nSee the `comb-default-keybindings` alist to obtain the functions used by the\ndefault keybindings.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyrus-and%2Fcomb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyrus-and%2Fcomb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyrus-and%2Fcomb/lists"}