{"id":16659882,"url":"https://github.com/venantius/yagni","last_synced_at":"2025-04-04T12:10:10.363Z","repository":{"id":28761794,"uuid":"32284010","full_name":"venantius/yagni","owner":"venantius","description":"A Leiningen plugin for finding dead code","archived":false,"fork":false,"pushed_at":"2021-09-30T13:07:31.000Z","size":65,"stargazers_count":219,"open_issues_count":10,"forks_count":10,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-02T13:11:37.320Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/venantius.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":"2015-03-15T21:05:12.000Z","updated_at":"2024-05-07T17:44:57.000Z","dependencies_parsed_at":"2022-09-04T23:00:41.376Z","dependency_job_id":null,"html_url":"https://github.com/venantius/yagni","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/venantius%2Fyagni","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/venantius%2Fyagni/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/venantius%2Fyagni/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/venantius%2Fyagni/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/venantius","download_url":"https://codeload.github.com/venantius/yagni/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247174456,"owners_count":20896078,"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":[],"created_at":"2024-10-12T10:26:58.406Z","updated_at":"2025-04-04T12:10:10.347Z","avatar_url":"https://github.com/venantius.png","language":"Clojure","funding_links":[],"categories":["Code Analysis and Linter"],"sub_categories":[],"readme":"# Yagni\n[![Build Status](https://travis-ci.org/venantius/yagni.svg?branch=master)](https://travis-ci.org/venantius/yagni)\n[![Dependency Status](https://www.versioneye.com/user/projects/5585e7f0363861001b000215/badge.svg?style=flat)](https://www.versioneye.com/user/projects/5585e7f0363861001b000215)\n[![Clojars Project](https://img.shields.io/clojars/v/venantius/yagni.svg)](https://clojars.org/venantius/yagni)\n\n[Yagni](http://martinfowler.com/bliki/Yagni.html) - You Aren't Gonna Need It.\n\nYagni is a static code analyzer that helps you find unused code in your \napplications and libraries.\n\nI've written a blog post describing Yagni in greater depth [here](http://blog.venanti.us/yagni/).\n\n## Background\n\nNo matter how it happens, sooner or later an application is going to end up\nwith unused code. It's time to call Yagni, the exterminator. \n\nYagni works by identifying all of the interned vars and declared Java classes\nin the namespaces findable within your `:source-paths`, and then walking the \nforms of those vars and declarations.\n\nAs it walks the forms, it builds a graph of references to other vars and \ndeclarations. It then searches the graph from a set of entrypoints (by default\nyour project's `:main` method), and emits warnings for anything that it \ncouldn't find in the graph's search.\n\n## Installation\n\nMerge the following into your `~/.lein/profiles.clj`:\n\n```clojure\n{:user {:plugins [[venantius/yagni \"0.1.7\"]]}}\n```\n\n## Usage\n\nTo have Yagni search for dead code, just run:\n\n    $ lein yagni\n\n## Usage from `deps.edn`\n\nYou can also use Yagni via a `deps.edn` alias. Merge this with your `deps.edn`:\n\n```clojure\n{:aliases {:yagni\n           {:extra-deps {venantius/yagni {:mvn/version \"0.1.7\"}}\n            :exec-fn yagni.core/run-yagni\n            :exec-args {:source-paths [\"src/clj\"]\n                        :main your.project}}}\n```\n\nAnd then run:\n\n    $ clj -X:yagni\n\n## Configuration\n\nYagni works by searching your codebase from an initial set of entrypoints.\nBy default, Yagni assumes that the only entrypoint for your project is the one\nlisted in your project.clj's `:main` key. Obviously, this is only useful for\napplications and tools with CLI invocations.\n\nAs libraries, multi-main programs, and certain other types of projects either\ntend to have no `:main` or many entrypoint methods, you can instead enumerate\na list of entrypoints for your project in a `.lein-yagni` file in the root \ndirectory of your project. Feel free to take a look at the one in this project\nas an example.\n\n## Examples\n\nRunning `lein yagni` on the sample project located [here](https://github.com/venantius/yagni-test) will emit the following output:\n\n```\n$ lein yagni\n=================== WARNING: Parents ======================\n== Could not find any references to the following vars. ===\n===========================================================\n\nsecondns/func-the-second\n\n================== WARNING: Children ======================\n== The following vars have references to them, but their ==\n== parents do not.                                       ==\n===========================================================\n\nsecondns/notafunc\n```\n\n## Contributing\n\nIn general, bug reports, fixes, and code cleanup are always appreciated. \nFeature requests are liable to be subject to a bit more discussion. \n\nWhen filing issues, please include the following:\n\n * The operating system\n * The JDK version\n * The Leiningen version\n * The Clojure version\n * Any plugins and dependencies in your `project.clj` and your `~/.lein/profiles.clj`\n\n## License\n\nCopyright © 2018 W. David Jarvis\n\nDistributed under the Eclipse Public License, the same as Clojure.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvenantius%2Fyagni","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvenantius%2Fyagni","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvenantius%2Fyagni/lists"}