-
Notifications
You must be signed in to change notification settings - Fork 218
Add -Werror=unused-imports to all IHP packages #2382
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
Open
mpscholten
wants to merge
28
commits into
master
Choose a base branch
from
add-werror-unused-imports
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+42
−202
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 packages already had this flag; add it to the remaining 20 so unused imports are caught as hard errors across the entire monorepo. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
e51b665 to
d7da431
Compare
Redundant under GHC2021 — `maybe` and `fmap` are re-exported from Prelude. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Restore Data.Either import for Right constructor (needed with NoImplicitPrelude) and add Test.Postgres.Support () imports for the orphan Eq Action instance needed by shouldBe. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The Serialize class is accessed through the qualified import. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
void is in GHC2021 Prelude, HasField is in GHC2021. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
HasField is included in GHC2021 Prelude. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
GHC2021 enables HasField but does not re-export the class from Prelude — explicit import is required when used by name. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Data.Proxy redundant in ModelSupport/Types (re-exported by GHC2021) - GHC.OverloadedLabels redundant in Record (enabled by GHC2021) - System.IO.Unsafe unused in RequestVault/Helper - Prelude redundant in Static (nothing used beyond GHC2021 built-ins) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Hasql/Encoders: remove unused ByteString qualified, Data.Word, >$< from Contravariant, Vector qualified - Hasql/FromRow: remove unused sepBy from Attoparsec - Controller/Session: remove redundant GHC.Records and unused Id - HaskellSupport: remove unused GHC.Records qualified - RequestVault/ModelContext: remove redundant Prelude import Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- NameSupport.hs: remove unused qualified Data.Char - Tailwind.hs: remove duplicate Data.Default import, remove unused IHP.ModelSupport.Types - Bootstrap.hs: remove duplicate Data.Default import Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove redundant imports flagged by GHC 9.10: - Data.Hashable, Control.DeepSeq, Data.List, Data.ByteString.Char8 - Database.PostgreSQL.Simple.ToField (both unqualified and qualified) - Database.PostgreSQL.Simple.Types (qualified), FromRow (qualified), ToRow (qualified) - Data.Time.Format.ISO8601, GHC.Types, Numeric, Data.Text.Encoding - Duplicate Hasql.Errors import Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Compiler.hs: remove redundant IHP.NameSupport import - FrameworkConfig.hs: remove redundant Network.Wai import Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- HasqlCompiler.hs: remove redundant Data.Int - Filter.hs: remove redundant IHP.ModelSupport.Types, Data.Text, Hasql.DynamicStatements.Snippet (unqualified) - RequestVault.hs: remove redundant Data.Proxy, Data.Typeable Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Param.hs: remove 12 redundant imports (Data.Either, Wai.Request.Params.Middleware, Data.UUID, Data.ByteString.Char8, GHC.TypeLits, GHC.Float, Control.Exception, Data.Aeson.KeyMap, Data.Aeson.Key, Data.Scientific, Data.Vector, Text.Read) - Context.hs: remove redundant IORef from Data.IORef, remove redundant qualified IHP.ControllerContext import Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- FileUpload.hs: remove redundant IHP.Controller.Context - ControllerSupport.hs: remove redundant Data.Text, RequestBody from Wai.Request.Params.Middleware, and unqualified IHP.Controller.Context import Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- FileUpload.hs: restore IHP.Controller.Context import for instances (HasField "parsedBody" instance needed) - ControllerSupport.hs: keep ControllerContext(ControllerContext) import (used unqualified in type signatures), only remove customFieldsRef Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
GHC 9.10 considers the unqualified import of ControllerContext redundant (it's available via the qualified import). Rather than suppressing the warning, qualify all uses as Context.ControllerContext. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…, BasicAuth, AutoRefresh Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…/Controller.hs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…lude.hs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…rollerPrelude The hiding import hid the module's only export (setModal), so the module re-export was already a no-op. setModal is still exported directly via the qualified import. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…pport/Controller/Sessions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
-Werror=unused-importsto the 20 packages that only had-Werror=incomplete-patterns-Wunused-importsin ghciTest plan
-Werror=unused-imports-Wunused-imports— no violationsnix flake check🤖 Generated with Claude Code