{"id":13687649,"url":"https://github.com/serokell/importify","last_synced_at":"2025-05-01T13:30:43.790Z","repository":{"id":59153329,"uuid":"92622410","full_name":"serokell/importify","owner":"serokell","description":":space_invader: Importi.fy — it's like Uber, but for Haskell modules.","archived":true,"fork":false,"pushed_at":"2018-09-02T06:25:52.000Z","size":357,"stargazers_count":104,"open_issues_count":19,"forks_count":9,"subscribers_count":33,"default_branch":"master","last_synced_at":"2024-10-03T00:47:54.923Z","etag":null,"topics":["haskell","imports","refactoring-tools"],"latest_commit_sha":null,"homepage":"","language":"Haskell","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/serokell.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null}},"created_at":"2017-05-27T20:28:32.000Z","updated_at":"2024-03-20T18:36:46.000Z","dependencies_parsed_at":"2022-09-13T11:01:14.830Z","dependency_job_id":null,"html_url":"https://github.com/serokell/importify","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serokell%2Fimportify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serokell%2Fimportify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serokell%2Fimportify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serokell%2Fimportify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serokell","download_url":"https://codeload.github.com/serokell/importify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224257881,"owners_count":17281789,"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":["haskell","imports","refactoring-tools"],"created_at":"2024-08-02T15:00:58.043Z","updated_at":"2025-05-01T13:30:43.782Z","avatar_url":"https://github.com/serokell.png","language":"Haskell","funding_links":[],"categories":["Haskell"],"sub_categories":[],"readme":"# importify — manage Haskell imports quickly\n\n[![Build Status](https://travis-ci.org/serokell/importify.svg)](https://travis-ci.org/serokell/importify)\n[![Hackage](https://img.shields.io/hackage/v/importify.svg)](https://hackage.haskell.org/package/importify)\n[![Stackage Nightly](http://stackage.org/package/importify/badge/nightly)](http://stackage.org/nightly/package/importify)\n[![Stackage LTS](http://stackage.org/package/importify/badge/lts)](http://stackage.org/lts/package/importify)\n[![HLint Status](https://codeclimate.com/github/serokell/importify/badges/issue_count.svg)](https://codeclimate.com/github/serokell/importify)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n## _Importify_ in a nutshell.\n\n`importify` tool helps you to manage the import section of your Haskell project modules.\nGHC compiler can warn you about unused imports, and it's a good practice to remove such\nimports immediately. But this becomes tedious, especially if you use explicit import lists.\n\n_Importify_ can remove unused imports automatically.\n\nBefore importify |  After importify\n:---------------:|:-----------------:\n![Module with imports mess](https://user-images.githubusercontent.com/4276606/29321624-b6c2e11a-81e3-11e7-9003-da2a399c9161.png) | ![After removing all unused imports](https://user-images.githubusercontent.com/4276606/29321628-b98afb30-81e3-11e7-855f-3430fe9d250f.png)\n\nYou can use [`stylish-haskell`](https://github.com/jaspervdj/stylish-haskell) after `importify` to prettify imports.\n\nIn the future, we plan for _Importify_ to be able to:\n\n + Add missing imports automatically, so you won't have to manage\n   imports manually at all.\n + Implement a cache server with the following features:\n   + Download caches for Hackage packages to speed up _Importify_ runs.\n   + Upload your caches for yet-to-be-published FOSS projects to\n     make it easier to collaborate.\n   + Query mappings from any module of every package to symbols\n     exported by it to write your refactoring tools.\n + Convert imports between _implicit_ and _explicit_, and between\n   _qualified_ and _unqualified_ forms.\n + Resolve merge conflicts in import section automatically. See an\n   example of [such conflict](http://i.imgur.com/97YVCFk.png).\n\n## Installation\n\nInstallation process assumes that you have already installed and configured `stack`\nbuild tool. Currently `importify` works only with projects built with `stack`.\n\n### Installing from Stackage\n\nInstall just as every usual package.\n\n```bash\nstack install importify\n```\n\n### Installing from source\n\nPerform the next steps before driving:\n\n```bash\ngit clone https://github.com/serokell/importify.git  # 1. Clone repository locally\ncd importify                                         # 2. Step into folder\nstack install importify\\:exe\\:importify              # 3. Copy executable under ~/.local/bin\n```\n\n## Usage\n\nIn short:\n\n```bash\n$ cd my-project-which-build-with-stack\n$ importify cache\n$ importify file path/to/File/With/Unused/Imports.hs\n```\n\n`importify` has several commands. Most important is\n\n```\nimportify --help\n```\n\nBefore removing redundant imports run `importify cache`\ncommand. Importify stores local cache for the project under the\n`.importify` folder inside your project. This cache stores exported\nentities for each module for every dependency and for all your local\npackages. Make sure to re-run `importify cache` if you change the list\nof exported functions and types in your project modules. Cache is\nbuilt incrementally; it builds dependencies only once. But if you add\ndependencies or use other versions of them (for instance, because of\nbumping stack lts) you need to run `importify cache` again. You can\nalways perform `rm -rf .importify` before caching if you face any\ntroubles.\n\nAfter the cache is built, you can use `importify file PATH_TO_FILE`\ncommand from your project root directory. This command runs\n_Importify_ on the file and prints the result in the terminal. If you\nwant to change a file in-place use the following command:\n\n```\nimportify file -i PATH_TO_FILE\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserokell%2Fimportify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserokell%2Fimportify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserokell%2Fimportify/lists"}