Add Copilot instructions to suppress false positives on shared qualified import aliases#1132
Conversation
|
@copilot see the PR description template in the repo, change the PR template to match it |
Updated the PR description to follow the repository template format (Changelog YAML, Context, How to trust this PR, Checklist). |
|
@copilot Rebase just your commit with a change onto master, then push with force to update this branch. |
There was a problem hiding this comment.
Pull request overview
Adds repository-level GitHub Copilot guidance for a Haskell-specific import pattern, and refactors/extends the test suite by moving calcMinFeeRecursive properties into a dedicated module.
Changes:
- Add
.github/copilot-instructions.mddocumenting that shared qualified import aliases are valid in GHC Haskell and shouldn’t be flagged by Copilot. - Extract
calcMinFeeRecursiveproperty tests into newTest.Cardano.Api.Experimental.Feeand wire it into the test runner and cabal test-suite. - Export
exampleProtocolParamsfromTest.Cardano.Api.Experimentalso it can be reused by the new fee test module.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
.github/copilot-instructions.md |
Adds Copilot instructions about shared qualified import aliases in Haskell. |
cardano-api/test/cardano-api-test/cardano-api-test.hs |
Registers and runs the new Experimental.Fee test group. |
cardano-api/test/cardano-api-test/Test/Cardano/Api/Experimental/Fee.hs |
New property-test module covering calcMinFeeRecursive scenarios. |
cardano-api/test/cardano-api-test/Test/Cardano/Api/Experimental.hs |
Removes inlined fee properties and exports exampleProtocolParams for reuse. |
cardano-api/cardano-api.cabal |
Adds the new fee test module to the cardano-api-test suite other-modules. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| fundingTxOut = | ||
| Exp.obtainCommonConstraints era $ | ||
| L.mkBasicTxOut addr (L.MaryValue fundingCoin mempty) | ||
| utxo = L.UTxO $ Map.singleton ledgerTxIn fundingTxOut | ||
| sendTxOut = | ||
| Exp.obtainCommonConstraints era $ | ||
| Exp.TxOut $ | ||
| Ledger.mkBasicTxOut addr (L.MaryValue sendCoin mempty) |
There was a problem hiding this comment.
Within this module, mkBasicTxOut is called sometimes via L.mkBasicTxOut and sometimes via Ledger.mkBasicTxOut, even though both qualifiers refer to Cardano.Api.Ledger. Using a single qualifier consistently here (as in Test.Cardano.Api.Experimental) would reduce confusion, especially given L is also shared by multiple Ledger modules in these tests.
I can perform the rebase locally, but I'm unable to force-push — my tooling only supports regular git fetch origin master
git checkout copilot/sub-pr-1128-again
git rebase --onto origin/master de666e0~1 HEAD
git push --force origin copilot/sub-pr-1128-againThis will drop the |
…ll qualified import aliases Co-authored-by: carbolymer <228866+carbolymer@users.noreply.github.com>
31c9bff to
828d721
Compare
Changelog
Context
GitHub Copilot incorrectly flagged multiple modules sharing the same qualified import alias as a compile error (e.g., both
Cardano.Api.ExperimentalandCardano.Api.Experimental.Tximportedas Exp). This is valid GHC Haskell — name resolution happens at the use site, and ambiguity only arises if both modules export the same identifier used without disambiguation.Addresses feedback from #1128.
How to trust this PR
The only file changed is
.github/copilot-instructions.md. Verify its content explains the valid Haskell qualified-alias pattern correctly.Checklist
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.