Skip to content

Make it possible to restrict the number of explicit imports #1676

@crtschin

Description

@crtschin

There isn't much support for styles where one imports unqualified. It'd be nice to have a hlint rule that tries to restrict the number of explicit imports so the user either imports qualified or unqualified, but not to have import lists 20-long, which is quite easy to get to in this HLS-age.

-- Given a setting "explicitImportLengthLimit: 3"
--
-- Would reject
import Control.Monad.State (get, put, state, modify, gets) 

-- Would accept
import Control.Monad.State (get, put, state) 
import Control.Monad.State qualified as State
import Control.Monad.State

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions