Skip to content

Add the ci flag and fix every warning it turns up - #6

Draft
onslaughtq wants to merge 3 commits into
pr-2-multiline-and-handle-exportsfrom
add-ci-flag
Draft

Add the ci flag and fix every warning it turns up#6
onslaughtq wants to merge 3 commits into
pr-2-multiline-and-handle-exportsfrom
add-ci-flag

Conversation

@onslaughtq

Copy link
Copy Markdown
Member

Adds the ci flag the other repos use, carrying -Wall -Werror and the strict warning set, switched on for all three packages in stack-base.yaml. It's manual and defaults off, so Hackage consumers never see it.

-Wall reported 27 warnings in ftp-client and 22 across the other two. Most were mechanical. Three weren't:

The record update in connectTLS was incomplete, because TLSSettings is a sum type and settingDisableCertificateValidation only exists on TLSSettingsSimple. Rebuilding just that constructor keeps it working on crypton-connection 0.3, which lacks the field a positional call would need.

MonadResource is in five exported signatures of the conduit package but Conduit re-exports it, so the direct resourcet import counted as unused, and -Wunused-packages then rejected the dependency itself. Taking the name from resourcet and hiding it from the Conduit import satisfies both without dropping a dependency whose types are in the public API.

Producer and Consumer are deprecated conduit synonyms, five of them in exported signatures. They expand to forall i. ConduitT i o m () and forall o. ConduitT i o m r, not to ConduitT () o m () and ConduitT i Void m r — those are Source and Sink. Rewriting them with the type variables left free keeps the exported types identical.

Two smaller notes: -Wmissed-specialisations never fired, so no pragmas were needed, and GHC 9.12 is the only version that rejects deriving Typeable, a no-op since 7.10.

This also exports acct, pbsz, prot, ccc and auth, which were defined but never exported. ccc and auth come back out at the top of the stack — neither can work outside the sequence createTLSConnection uses.

Stacked: add-ci-multi-ghcfix-response-line-partialitypr-2-multiline-and-handle-exportsadd-ci-flagadd-henforcer-fourmolufix-audit-findings. Merge bottom-up.

Follows bounded-text, beeline, shrubbery, orb, rollbar-haskell and
haskell-non-empty-text, which all carry a manual ci flag holding the strict
ghc-options. Two deviations from that list: no henforcer plugin, since this
repo has no henforcer.toml and its open imports would fail immediately, and
no -Wmissing-import-lists, which would rewrite thirteen imports in the file
PR #2 also edits.

The flag is manual and defaults off, so nothing reaches Hackage consumers.
It is enabled for all three packages in stack-base.yaml, so every rung of
the matrix builds with -Werror. Libraries get no ghc-options at all when the
flag is off, as before -- an -O2 in the else branch would have imposed it on
downstream users, and cabal check says so.

Roughly fifty warnings across the four source files. Most were mechanical:
unused imports and do-binds, shadowed names, missing local signatures. Three
were not:

The record update at connectTLS was incomplete because TLSSettings is a sum
type and settingDisableCertificateValidation only exists on TLSSettingsSimple.
Rebuilding just that constructor keeps it working on crypton-connection 0.3,
which lacks the settingClientSupported field a positional call would need.

Producer and Consumer are deprecated conduit synonyms, five of them in
exported signatures. They expand to `forall i. ConduitT i o m ()` and
`forall o. ConduitT i o m r`, not to ConduitT () o m () and ConduitT i Void
m r -- those are Source and Sink. Rewriting them with the type variables left
free keeps the exported types identical; pinning them to ()/Void would have
narrowed the API and broken the internal fusion in mlsd and stor.

MonadResource is in five exported signatures but is re-exported by Conduit,
so the direct resourcet import counted as unused and -Wunused-packages then
rejected the dependency. Taking the name from resourcet explicitly and hiding
it from the Conduit import keeps the dependency and its version bound honest.

transformers comes out of ftp-client and containers out of example; neither
was imported anywhere. Deriving Typeable is dropped -- a no-op since GHC 7.10
that only GHC 9.12 warns about -- and acct, pbsz, prot, ccc and auth are now
exported rather than sitting unused, matching every other command wrapper.
cabal check flagged bytestring, conduit and exceptions as having no upper
bound. The bounds match what the matrix actually exercises -- conduit 1.3.5
through 1.3.6.1, bytestring 0.11.4.0 through 0.12.2.0, exceptions 0.10.4
through 0.10.12 -- rounded to the next major in each case, and the bytestring
and exceptions ranges are spelled the same way ftp-client already spells them.

Existing lower bounds are left alone; only the missing upper halves are added.
cabal check is now clean on both published packages.
ftp-client gains five exports -- acct, pbsz, prot, ccc and auth -- which is
an additive API change, so PVP asks for a minor bump. It also loses the
transformers dependency and the no-op Typeable deriving.

ftp-client-conduit only gains dependency bounds; the Producer and Consumer
rewrite is type-identical because the type variables are left free, so a
patch bump covers it.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds opt-in strict CI compiler warnings across all packages and resolves the resulting warnings.

Changes:

  • Adds and enables the ci build flag for Stack builds.
  • Cleans up warnings, dependencies, and deprecated Conduit types.
  • Exports additional FTP/TLS commands and bumps package versions.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
stack-base.yaml Enables CI flags for all packages.
ftp-client/test/test.hs Resolves test warnings.
ftp-client/src/Network/FTP/Client.hs Exports commands and fixes warnings.
ftp-client/package.yaml Adds CI configuration and bumps version.
ftp-client/ftp-client.cabal Synchronizes generated package metadata.
ftp-client/CHANGELOG.md Documents the release.
ftp-client-conduit/test/Spec.hs Resolves test warnings.
ftp-client-conduit/src/Network/FTP/Client/Conduit.hs Replaces deprecated Conduit aliases.
ftp-client-conduit/package.yaml Adds CI configuration and dependency bounds.
ftp-client-conduit/ftp-client-conduit.cabal Synchronizes generated package metadata.
ftp-client-conduit/CHANGELOG.md Documents the release.
example/test/Spec.hs Adds an explicit module export.
example/package.yaml Adds CI configuration.
example/example.cabal Synchronizes generated package metadata.
example/app/Main.hs Resolves example warnings.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

- ftp-client == 0.5.*
- conduit >= 1.1
- bytestring
- conduit >= 1.1 && < 1.4
, bytestring
, conduit >=1.1
, bytestring >=0.10.8.2 && <0.13
, conduit >=1.1 && <1.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants