Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport #10719: Follow HLint suggestion: use fewer imports #10733

Open
wants to merge 6 commits into
base: 3.14
Choose a base branch
from

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jan 9, 2025

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).

This is an automatic backport of pull request #10719 done by [Mergify](https://mergify.com).

- 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
(cherry picked from commit d165dfd)

# Conflicts:
#	.hlint.yaml
@mergify mergify bot added the conflicts label Jan 9, 2025
Copy link
Contributor Author

mergify bot commented Jan 9, 2025

Cherry-pick of 217f08a has failed:

On branch mergify/bp/3.14/pr-10719
Your branch is ahead of 'origin/3.14' by 1 commit.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit 217f08ac5.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   Cabal/src/Distribution/Compat/Internal/TempFile.hs
	modified:   Cabal/src/Distribution/Compat/Time.hs
	modified:   Cabal/src/Distribution/Simple/GHC.hs
	modified:   cabal-install/src/Distribution/Client/CmdTest.hs
	modified:   cabal-install/src/Distribution/Client/Config.hs
	modified:   cabal-install/src/Distribution/Client/ProjectPlanning.hs
	modified:   cabal-install/src/Distribution/Client/SetupWrapper.hs
	modified:   cabal-install/src/Distribution/Client/Store.hs

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	both modified:   .hlint.yaml
	both modified:   cabal-install/tests/IntegrationTests2.hs
	deleted by us:   cabal-testsuite/src/Test/Cabal/NeedleHaystack.hs

Cherry-pick of d165dfd has failed:

On branch mergify/bp/3.14/pr-10719
Your branch is ahead of 'origin/3.14' by 2 commits.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit d165dfda4.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   .hlint.yaml

no changes added to commit (use "git add" and/or "git commit -a")

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@mergify mergify bot added the backport label Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants