Skip to content

Conversation

philderbeast
Copy link
Collaborator

See #9110. The HLint "use fewer imports" suggestion was too much trouble to enable before most of the base CPP conditionals, "base 4.13 and older", were removed in #10092.

We're using fourmolu but this doesn't merge multiple imports from the same module.

The removal of MIN_VERSION_base(4,11,0) is permitted by #8998 (comment) and #8998 (comment).

Two files used for our tests taken from other projects are now ignored for linting, in .hlint.yaml:

 - arguments:
+    - --ignore-glob=Cabal-tests/tests/custom-setup/CabalDoctestSetup.hs
+    - --ignore-glob=Cabal-tests/tests/custom-setup/IdrisSetup.hs

The first of these, CabalDoctestSetup.hs, was mentioned by @Kleidukos in #8998 (comment).


Template B: This PR does not modify behaviour or interface

E.g. the PR only touches documentation or tests, does refactorings, etc.

Include the following checklist in your PR:

  • Patches conform to the coding conventions.
  • Is this a PR that fixes CI? If so, it will need to be backported to older cabal release branches (ask maintainers for directions).

Copy link
Collaborator

@ulysses4ever ulysses4ever left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mergify mergify bot added the ready and waiting Mergify is waiting out the cooldown period label Jan 7, 2025
@philderbeast
Copy link
Collaborator Author

Label merge+no rebase is necessary when the pull request is from an organisation.

- Use fewer imports with CPP in Compat.Time
- Use fewer imports in IntegrationTests2
- Use fewer imports in Distribution.Client.ProjectPlanning
- Use fewer imports in Distribution.Client.Config
- Use fewer imports in Distribution.Client.NixStyleOptions
- Use fewer imports in Internal.TempFile
- Use fewer imports in Distribution.Client.Store
- Use fewer imports in Distribution.Client.SetupWrapper
- Use fewer imports in Disribution.Simple.GHC
- Use fewer imports in NeedleHaystack
- Remove unused -XCPP from Client.ProjectPlanning
- Enable hlint suggestion "Use fewer imports"
- Ignore custom setup test files from Idris and Doctest
@philderbeast philderbeast force-pushed the hlint/use-fewer-imports branch from 45b6275 to d165dfd Compare January 7, 2025 16:19
@mergify mergify bot added the merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days label Jan 9, 2025
@mergify mergify bot merged commit 45e3289 into haskell:master Jan 9, 2025
50 checks passed
@Kleidukos
Copy link
Member

@Mergifyio backport 3.14

Copy link
Contributor

mergify bot commented Jan 9, 2025

backport 3.14

✅ Backports have been created

mergify bot added a commit that referenced this pull request Mar 31, 2025
* Remove CPP MIN_VERSION_base(4,11,0) in Cabal.Monad

(cherry picked from commit c7f3def)

* Follow hlint suggestion: use fewer imports

- Use fewer imports with CPP in Compat.Time
- Use fewer imports in IntegrationTests2
- Use fewer imports in Distribution.Client.ProjectPlanning
- Use fewer imports in Distribution.Client.Config
- Use fewer imports in Distribution.Client.NixStyleOptions
- Use fewer imports in Internal.TempFile
- Use fewer imports in Distribution.Client.Store
- Use fewer imports in Distribution.Client.SetupWrapper
- Use fewer imports in Disribution.Simple.GHC
- Use fewer imports in NeedleHaystack
- Remove unused -XCPP from Client.ProjectPlanning
- Enable hlint suggestion "Use fewer imports"
- Ignore custom setup test files from Idris and Doctest

(cherry picked from commit 217f08a)

# Conflicts:
#	.hlint.yaml
#	cabal-install/tests/IntegrationTests2.hs
#	cabal-testsuite/src/Test/Cabal/NeedleHaystack.hs

* Bump hlint warning counts

(cherry picked from commit d165dfd)

# Conflicts:
#	.hlint.yaml

* resolve conflicts

* remove redundant imports

* fix style

---------

Co-authored-by: Phil de Joux <[email protected]>
Co-authored-by: Hécate <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days merge+no rebase ready and waiting Mergify is waiting out the cooldown period
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants