IntersectMBO / IntersectMBO/cardano-ledger

Activate -Wmissing-import-lists in `cardano-ledger-api`

Open
#3,179 0 comments 0 reactions 0 assignees View on GitHub
api-v1
Dominant language
Haskell
Stars
295
Forks
179
Avg merge
4d 7h
Merged PRs (30d)
29

Description

**Context**

The `cardano-ledger-api` Haskell package will eventually be the place were external developers look into in order to do various ledger stuff, like building transactions. Therefore, the source code will be read by many external developers who are not familiar with the `cardano-ledger` internal libraries.

`import X` without qualifications or named imports makes it very hard to tell where a particular function comes from.

**Proposal**

Activate the `-Wmissing-import-lists` only in `cardano-ledger-api`

Imports will have to take the form:

`import qualified X as Y`

or

`import X (foo, bar)`

The flag will even force explicit constructor names as well instead of `DataType(..)`

Contributor guide

Open the contributing guide

Research direction

Start by locating the cardano-ledger-api package configuration and its Haskell modules. Enable -Wmissing-import-lists there, update imports to use qualified or explicit import lists, and confirm the package builds without warnings, including explicit constructor names where required.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
api
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.