{"id":20150712,"url":"https://github.com/luhring/funky","last_synced_at":"2025-03-03T01:15:03.693Z","repository":{"id":57623191,"uuid":"393939775","full_name":"luhring/funky","owner":"luhring","description":"A Go (golang) linter that finds mutations.","archived":false,"fork":false,"pushed_at":"2021-08-21T12:57:58.000Z","size":40,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-13T11:49:51.371Z","etag":null,"topics":["ast","functional-programming","golang","linter","mutations"],"latest_commit_sha":null,"homepage":"","language":"Go","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/luhring.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}},"created_at":"2021-08-08T11:19:12.000Z","updated_at":"2022-10-19T19:39:12.000Z","dependencies_parsed_at":"2022-08-26T23:51:43.052Z","dependency_job_id":null,"html_url":"https://github.com/luhring/funky","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luhring%2Ffunky","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luhring%2Ffunky/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luhring%2Ffunky/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luhring%2Ffunky/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luhring","download_url":"https://codeload.github.com/luhring/funky/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241592151,"owners_count":19987311,"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":["ast","functional-programming","golang","linter","mutations"],"created_at":"2024-11-13T22:53:05.647Z","updated_at":"2025-03-03T01:15:03.667Z","avatar_url":"https://github.com/luhring.png","language":"Go","readme":"# funky 🎸\n\nA Go (golang) linter that finds mutations.\n\n## Installation\n\n```\ngo install github.com/luhring/funky/cmd/funky@main\n```\n\n## Usage\n\n```\nfunky ./directory-with-go-files\n```\n\n(**Note:** Funky doesn't yet analyze directories _recursively_. 😳)\n\n### Example output\n\n```\nadd.go:134:3: mutation: \"destfi\" was assigned a new value: nil\nadd.go:155:5: mutation: \"d\" was assigned a new value: filepath.Join(dest, path.Base(url.Path))\nadd.go:157:7: mutation: \"err\" was assigned a new value: addURL(d, src, hostOwner, options.Hasher)\nadd.go:175:4: mutation: \"err\" was assigned a new value: os.Stat(esrc)\n```\n\n## What is a \"mutation\"?\n\nA mutation is when a variable's value changes. In the Go language, this means an assignment of a value to a variable anywhere **other than** where that variable is declared.\n\nFor example, here's some Go code that has a few mutations:\n\n```go\npackage main\n\nvar x = 1 // Not a mutation. This is where `x` is declared.\n\nfunc main() {\n    x = 7 // MUTATION! (... of `x`, which is declared as a package-level variable.)\n\n    var output string // Not a mutation. This is where `output` is declared, and it's implicitly being assigned the zero-value of the `string` type, which is \"\".\n\n    if someCondition {\n    \toutput = \"new value\" // MUTATION!\n    }\n\n    print(output)\n}\n```\n\n\n## The mission: functional programming for Go\n\nFunky's objective is to take the approaches of functional programming and apply them to the Go language.\n\nThe first task is to alert developers to the presence of **mutations**.\n\nMutations introduce complexity in code. Because of this, they make code more likely to introduce bugs and more difficult to comprehend. Funky alerts you to the mutations in your code so you can spot opportunities for making your code less complex and more predictable — presumably, by adjusting your implementation to avoid mutations.\n\n### \"...but Go isn't a functional programming language\"\n\nThat's true (to some extent). But more developers are realizing the benefits of applying coding practices _taken from the functional paradigm_ to more languages than just the esoteric FP languages.\n\n## Roadmap\n\n- [ ] support for recursive directory analysis (e.g. `./...`)\n- [ ] CI pipeline\n- [ ] release pipeline\n- [ ] **feature:** avoiding mutations\n  - [x] mutation detection\n  - [ ] failure on mutation detection\n  - [ ] configurable exceptions to mutation detection-based failing\n- [ ] **feature:** avoiding side effects\n  - [ ] side effect detection\n  - [ ] failure on side effect detection\n  - [ ] configurable exceptions to side effect detection-based failing\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluhring%2Ffunky","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluhring%2Ffunky","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluhring%2Ffunky/lists"}