{"id":31595277,"url":"https://github.com/escherize/dredd","last_synced_at":"2025-10-06T03:59:10.781Z","repository":{"id":176204410,"uuid":"655148093","full_name":"escherize/dredd","owner":"escherize","description":"Automatically enforce judgements (tests)","archived":false,"fork":false,"pushed_at":"2023-11-29T16:40:16.000Z","size":24,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-11-29T17:41:45.499Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/escherize.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-06-18T03:26:59.000Z","updated_at":"2023-10-26T20:31:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"aafac389-cba0-4fd2-a196-b4c04c07b14f","html_url":"https://github.com/escherize/dredd","commit_stats":null,"previous_names":["escherize/dredd"],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/escherize/dredd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escherize%2Fdredd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escherize%2Fdredd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escherize%2Fdredd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escherize%2Fdredd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/escherize","download_url":"https://codeload.github.com/escherize/dredd/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escherize%2Fdredd/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278556181,"owners_count":26006081,"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","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-10-06T03:58:55.671Z","updated_at":"2025-10-06T03:59:10.766Z","avatar_url":"https://github.com/escherize.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dredd 🤖✏️🟩\n\nAutomatic Test Updates (and Enforcement someday)\n\n_Inspired by [judge](https://github.com/ianthehenry/judge)._\n\n## Usage\n\n1. Include dredd in your project.\n\n`io.github.escherize/dredd {:git/sha \"eb72b86b4861276485acbcab3f1374ec11e01592\"}`\n\n``` clojure\n(require '[dredd.core :refer [j]])\n```\n\n2. As you work, put in some `j` forms.\n\nA `j` form takes one or two values:\n\nJust one value: it will always eval to `:fail`.\n``` clojure\n(j (* 10 11))\n;;=\u003e :fail\n```\n\nThe wrong expected value will eval to `:fail`.\n``` clojure\n(j (* 10 11) \"wrong\")\n;;=\u003e :fail\n```\n\nThe right expected value evals to `:true` (🎉).\n```clojure\n(j (* 10 11) 110)\n;;=\u003e :pass\n```\n\n## Automatic-Rewrite API\n\nThere are 3 public entrypoints: `check`, `fix` and `ask`.\n\n### `fix`\n\nCalling `fix` on a namespace will rewrite all j forms to be correct.\n\n``` clojure\n(ns my-ns (:require [dredd.dredd :refer [j]]))\n;; blank\n(j (* 234 593 -3))\n;; wrong\n(j (first \"hi\") \\i)\n(comment (dredd/fix))\n```\nEvaluating `(dredd/fix)` in this namespace will _rewrite it to be_:\n``` clojure\n(ns my-ns (:require [dredd.dredd :refer [j]]))\n;; blank\n(j (* 234 593 -3) -416286)\n;; wrong\n(j (first \"hi\") \\h)\n(comment (dredd/fix))\n```\n\n### `ask`\n\n`ask` is similar to `fix`, but will show a prompt where you get shown\ninformation about the change you're about to make. Accept the change by entering\ny or just hitting enter, decline with n.\n\nHere's the output of me running ask from `dredd.dredd-test`, and sending \u003ckbd\u003ey\u003c/kbd\u003e + \u003ckbd\u003eEnter\u003c/kbd\u003e to stdin twice:\n\n``` text\n*==================================================\n*       Fixing judge at: dredd.dredd-test:23\n*       When evaluating: (* 10 10)\n*              Expected: No value was provided\n*      But it should be: 100\n*                    ---------\n* Do you want me to fix it? [Y/n]\nDredd is fixing j_23 to be 100\n\n*==================================================\n*       Fixing judge at: dredd.dredd-test:25\n*       When evaluating: (* 2 3)\n*              Expected: \"wrong\"\n*      But it should be: 6\n*                    ---------\n* Do you want me to fix it? [Y/n]\nDredd is fixing j_25 to be 6\n```\n\n And it's fixed.\n\n### `check`\n\nTo see the result of judges in your namespace without editing anything.\n\n``` clojure\n\n(dredd/check)\n;;=\u003e {:pass [test-one] :fail [test-two test-three]}\n```\n\n## Caveats\n\n- I wouldn't try it with think this with non-deterministic functions.\n\n- Your editor might not be happy having file contents ripped out from under it. Sorry!\n\n## Roadmap / TODOs / Ideas\n\n- [ ] check stdout of an expression\n- [ ] transform dredd to a simple deftest\n- [ ] transform a simple deftest to dredd\n- [ ] detect dredd forms if they aren't aliased as j or refer'd to directly\n- [ ] how to run as tests\n- [ ] say thanks to ianthehenry\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fescherize%2Fdredd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fescherize%2Fdredd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fescherize%2Fdredd/lists"}