https://github.com/elaforge/fix-imports
Automatically add and delete imports in a Haskell module.
https://github.com/elaforge/fix-imports
Last synced: 7 months ago
JSON representation
Automatically add and delete imports in a Haskell module.
- Host: GitHub
- URL: https://github.com/elaforge/fix-imports
- Owner: elaforge
- License: bsd-3-clause
- Created: 2018-02-27T19:08:36.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2025-02-19T12:43:04.000Z (over 1 year ago)
- Last Synced: 2025-06-19T08:13:53.373Z (12 months ago)
- Language: Haskell
- Size: 401 KB
- Stars: 17
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- License: LICENSE
Awesome Lists containing this project
README
`fix-imports` is a small standalone program to manage the import block of a
haskell program. It will try to add import lines for qualified names
with no corresponding import, remove unused import lines, and keep the
import block sorted, with optional rules for grouping.
Support for unqualified imports is limited to symbols you explicitly configure,
so if you list `System.FilePath ((>))`, it will add that import when you use
it, or remove when it's no longer used, but it won't go search modules for
unqualified imports.
It doesn't mess with non-managed unqualified imports, so you can still use
unqualified imports, you just have to do it manually.
Since it's a unix-style filter, it should be possible to integrate into any
editor. There's an example vimrc to bind to a key in vim.
### Usage:
Normally you would integrate it with your editor (see `vimrc` for a vim
example), but for testing, here's an example invocation:
fix-imports -i src -i test src/A/B/C.hs