{"id":15564128,"url":"https://github.com/dahlia/checkmate","last_synced_at":"2025-07-19T12:33:20.358Z","repository":{"id":62435705,"uuid":"103856979","full_name":"dahlia/checkmate","owner":"dahlia","description":"Generate checklists relevant to a given patch","archived":false,"fork":false,"pushed_at":"2018-08-31T18:52:42.000Z","size":85,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-07-11T02:07:32.909Z","etag":null,"topics":["checklist","code-review","linter","project-management"],"latest_commit_sha":null,"homepage":"https://hackage.haskell.org/package/checkmate","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dahlia.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-17T19:46:56.000Z","updated_at":"2021-04-16T18:04:05.000Z","dependencies_parsed_at":"2022-11-01T21:16:51.106Z","dependency_job_id":null,"html_url":"https://github.com/dahlia/checkmate","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/dahlia/checkmate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dahlia%2Fcheckmate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dahlia%2Fcheckmate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dahlia%2Fcheckmate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dahlia%2Fcheckmate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dahlia","download_url":"https://codeload.github.com/dahlia/checkmate/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dahlia%2Fcheckmate/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265934197,"owners_count":23852087,"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":["checklist","code-review","linter","project-management"],"created_at":"2024-10-02T16:37:35.721Z","updated_at":"2025-07-19T12:33:20.294Z","avatar_url":"https://github.com/dahlia.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"Checkmate\n=========\n\n[![Build Status][ci-badge]][ci]\n[![Hackage][hackage-badge]][hackage]\n[![GitHub release][release-badge]][latest release]\n\nCheckmate is a small program to generate human-readable checklists from\na given patch (or pull request).  Leave `CHECK` comments (that are the same\nfashion as `FIXME` or `TODO` comments); then Checkmate detects when a diff\ntouches some code scopes having any `CHECK` comments, and lists the checks.\n\nIt helps contributors and reviewers to remind matters that require attention\nwhen a part of the code is changed.\n\n[ci-badge]: https://travis-ci.com/dahlia/checkmate.svg?branch=master\n[ci]: https://travis-ci.com/dahlia/checkmate\n[hackage-badge]: https://img.shields.io/hackage/v/checkmate.svg\n[hackage]: https://hackage.haskell.org/package/checkmate\n[release-badge]: https://img.shields.io/github/release/dahlia/checkmate.svg?label=download\u0026colorB=4c1\n\n\nSituation\n---------\n\nLet's say there's a dictionary, and we should update the manual when a key\nis added to or removed from it:\n\n~~~~~~~~ python\nTARGET_LANGUAGES = {\n    # CHECK: Please update the manual on the project wiki when you add/remove\n    # a language.\n\n    'c': '*.c',\n    'java': '*.java',\n    'javascript': '*.js',\n    'python': '*.py',\n}\n~~~~~~~~\n\nThe above example may be artificial, but suppose lines of the dictionary are\nlengthy.  Such tasks should be done outside of the source code repository\nso that they cannot be automated by simply eliminating code duplicates.\nContributors and reviewers altogether are easy to forget about such tasks.\n\nTo remind peers of such tasks, Checkmate detects `CHECK` comments like the above\nexample when a relevant *code block* is touched and show peers a checklist.\n\n\nListing relevant checks: overlapped blocks\n------------------------------------------\n\nHow does Checkmate list only relevant checks to a diff?  It currently doesn't\nhave any language-specific algorithms, but only a language-agnostic heuristics\non indented blocks.\n\nSuppose the following diff:\n\n~~~~~~~~ diff\ndiff --git a/langs.py b/langs.py\n--- a/langs.py\n+++ b/langs.py\n@@ -5,6 +5,7 @@ TARGET_LANGUAGES = {\n     'c': '*.c',\n     'java': '*.java',\n     'javascript': '*.js',\n+    'haskell': '*.hs',\n     'python': '*.py',\n }\n \n~~~~~~~~\n\nSince it touched a code block with a `CHECK` comment, Checkmate generates\nthe following checklist:\n\n\u003e - Please update the manual on the project wiki when you add/remove a language.\n\nSuppose a patch touches only code blocks without any `CHECK` comments too, e.g.:\n\n~~~~~~~~ diff\ndiff --git a/langs.py b/langs.py\n--- a/langs.py\n+++ b/langs.py\n@@ -8,6 +8,7 @@ TARGET_LANGUAGES = {\n     'python': '*.py',\n }\n \n OTHER_DATA = {\n     # This code block is not relevant to TARGET_LANGUAGES.\n+    'haskell': '*.hs',\n }\n~~~~~~~~\n\nSince the touched block doesn't have any `CHECK` comments, Checkmate generates\nan empty checklist.\n\nNote that it doesn't parse code's semantics, but only scans blocks through\nindentation.  Even if a block is wrapped in curly braces without indentation,\nit isn't counted as a block.\n\n\nDirectory-level checklist\n-------------------------\n\nSome checks may need to be listed for a whole directory.  Checkmate recognizes\nfiles named *.check* or *CHECK* in a directory and include checks in that to\nthe checklist if any file in the directory are changed.  Its syntax is basically\na simple bullet list and a bullet can be `*`/`-`/`+`/`CHECK` or digits followed\nby `.`/`)`, e.g.:\n\n    - Check 1\n    - Check 2\n\n    + A plus sign too can be a bullet.\n    * An asterisk too.\n\n    1. Numbered-bullets also can be used.\n    2) A closing parenthesis as well can follow instead of a period.\n\n    CHECK: For consistency `CHECK` keyword also can be a bullet as well.\n    CHECK And a colon can be omitted.\n    Lines without any bullet is continued from previous line(s).\n\n\nDownload\n--------\n\nWe provide an official Linux x86_64 binary for [every release][].  See also\nthe [latest release][].  Note that official binaries are distributed as\nstatically-linked standalone executable, and they aren't gzipped.  Download and\ngive an `+x` permission; then it's ready.\n\nOn the other platforms you can download and install using Haskell [Cabal][]\nor [Stack][] since source tarballs also are distributed on [Hackage][]:\n\n~~~~~~~~ bash\nstack install checkmate\n~~~~~~~~\n\nNote: if you experience an error like `ConnectionFailure\nNetwork.BSD.getProtocolByName: does not exist (no such protocol name: tcp)`\non Debian/Ubuntu Linux, try to install [*netbase*][netbase] package.\n(Read [this explanation][1] for details.)\n\n[every release]: https://github.com/dahlia/checkmate/releases\n[latest release]: https://github.com/dahlia/checkmate/releases/latest\n[Cabal]: https://www.haskell.org/cabal/\n[Stack]: https://www.haskellstack.org/\n[netbase]: https://packages.debian.org/search?keywords=netbase\n[1]: https://github.com/commercialhaskell/stack/issues/2372#issuecomment-234113085\n\n\nIntegration with CI\n-------------------\n\nSince Checkmate usually is executed as a part of CI build, we show examples\nfor widely-used CI services.\n\nAll examples assume the environment variables are defined:\n\n -  `GITHUB_TOKEN` contains the access token to leave comments on a\n    corresponding GitHub repository.  See also GitHub's official article\n    about [personal API tokens][].\n -  `CHECKMATE_DOWNLOAD_URL` contains the download link to the prebuilt binary\n    of the latest release, i.e.:\n\n    ~~~~~~~ bash\n    CHECKMATE_DOWNLOAD_URL=https://github.com/dahlia/checkmate/releases/download/0.4.1/checkmate-linux-x86_64\n    ~~~~~~~\n\n[personal API tokens]: https://github.com/blog/1509-personal-api-tokens\n\n\n### Travis CI\n\n~~~~~~~~ yaml\ninstall:\n- curl -L -o ~/bin/checkmate \"$CHECKMATE_DOWNLOAD_URL\"\n- chmod +x ~/bin/checkmate\nscript:\n- ~/bin/checkmate github-travis --token \"$GITHUB_TOKEN\"\n~~~~~~~~\n\n\n### Circle CI\n\n~~~~~~~~ yaml\ndependencies:\n  post:\n  - curl -L -o ~/bin/checkmate \"$CHECKMATE_DOWNLOAD_URL\"\n  - chmod +x ~/bin/checkmate\ntest:\n  post:\n  - ~/bin/checkmate github-circle --token \"$GITHUB_TOKEN\"\n~~~~~~~~\n\n\n### Other CI softwares/services\n\nYou can run `checkmate github` command with explicit arguments:\n\n~~~~~~~~ bash\ncurl -L -o ~/bin/checkmate \"$CHECKMATE_DOWNLOAD_URL\"\nchmod +x ~/bin/checkmate\n# Suppose we're running a build of github.com/foo/bar/pull/123\n~/bin/checkmate github \\\n    --token \"$GITHUB_TOKEN\" \\\n    --login foo \\\n    --repo bar \\\n    --pr 123\n~~~~~~~~\n\nIf you're using GitHub Enterprise on premise use `--endpoint` option.\nFurther reading: `checkmate github --help`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdahlia%2Fcheckmate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdahlia%2Fcheckmate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdahlia%2Fcheckmate/lists"}