Repository navigation
Description
Description
The module copilot-bluespec:Copilot.Compile.Bluespec.Expr contains trailing spaces. It's best to remove them, since those are automatically removed by many editors, leading to PRs containing changes unrelated to the main issues being addressed.
In compliance with our coding standard, trailing space should be removed.
Type
- Bug: Code does not conform with our coding standards.
Additional context
None.
Requester
- Ivan Perez.
Method to check presence of bug
The offending lines can be found with the following query:
$ grep -nIHre ' \+$' *
copilot-bluespec/src/Copilot/Compile/Bluespec/Expr.hs:630: -- Bluespec internally represents all IEEE floating-point values as structs
copilot-bluespec/src/Copilot/Compile/Bluespec/Expr.hs:634: | isInfinite d = BS.CApply
copilot-bluespec/src/Copilot/Compile/Bluespec/Expr.hs:635: (BS.CVar $ BS.mkId BS.NoPos "infinity")
copilot-bluespec/src/Copilot/Compile/Bluespec/Expr.hs:637: then BS.CCon BS.idTrue []
copilot-bluespec/src/Copilot/Compile/Bluespec/Expr.hs:640:
copilot-bluespec/src/Copilot/Compile/Bluespec/Expr.hs:641: | isNaN d = let
copilot-bluespec/src/Copilot/Compile/Bluespec/Expr.hs:642: cexpr = BS.CHasType
copilot-bluespec/src/Copilot/Compile/Bluespec/Expr.hs:646: ( BS.CQType [] $ BS.TCon $
copilot-bluespec/src/Copilot/Compile/Bluespec/Expr.hs:647: BS.TyCon
copilot-bluespec/src/Copilot/Compile/Bluespec/Expr.hs:648: (BS.mkId BS.NoPos ctype)
copilot-bluespec/src/Copilot/Compile/Bluespec/Expr.hs:649: Nothing
copilot-bluespec/src/Copilot/Compile/Bluespec/Expr.hs:652: cval = case ty of
copilot-bluespec/src/Copilot/Compile/Bluespec/Expr.hs:653: Float -> fromIntegral $
copilot-bluespec/src/Copilot/Compile/Bluespec/Expr.hs:655: Double -> fromIntegral $
copilot-bluespec/src/Copilot/Compile/Bluespec/Expr.hs:658: ctype = case ty of
copilot-bluespec/src/Copilot/Compile/Bluespec/Expr.hs:663: | d == 0 = BS.CApply
copilot-bluespec/src/Copilot/Compile/Bluespec/Expr.hs:664: (BS.CVar $ BS.mkId BS.NoPos "zero")
copilot-bluespec/src/Copilot/Compile/Bluespec/Expr.hs:665: [ if isNegativeZero d
copilot-bluespec/src/Copilot/Compile/Bluespec/Expr.hs:666: then BS.CCon BS.idTrue []
copilot-bluespec/src/Copilot/Compile/Bluespec/Expr.hs:679:-- we need to convert NaN doubles safely into NaN floats. GHC Double2Float does not preserve signal nor payload
copilot-bluespec/src/Copilot/Compile/Bluespec/Expr.hs:682:uncastDoubleNaNToFloat nan = if (isSignaling nan)
copilot-bluespec/src/Copilot/Compile/Bluespec/Expr.hs:683: then (setPayloadSignaling payload)
copilot-bluespec/src/Copilot/Compile/Bluespec/Expr.hs:685: where Expected result
The result of the grep command above should be empty, indicating that no text files contain any trailing spaces.
Desired result
The result of the grep command above should be empty, indicating that no text files contain any trailing spaces.
Proposed solution
Remove all trailing spaces from any files that have them.
Further notes
None.
Activity
ivanperez-keera commentedon Oct 12, 2026
Change Manager: Confirmed that the issue exists.
ivanperez-keera commentedon Oct 12, 2026
Technical Lead: Confirmed that the issue should be addressed.
ivanperez-keera commentedon Oct 12, 2026
Technical Lead: Issue scheduled for fixing in Copilot 4.8.2.
Fix assigned to: @ivanperez-keera.
ivanperez-keera commentedon Oct 13, 2026
Implementor: Solution implemented, review requested.
ivanperez-keera commentedon Oct 13, 2026
Change Manager: Verified that:
Build log: https://app.travis-ci.com/github/Copilot-Language/copilot/builds/278978739
The following
Dockerfilechecks that there are no files in all of Copilot with trailing spaces, after which it prints the message "Success":No updates needed; change is to formatting.
No updates needed; change is to formatting and does not affect existing examples.
Bump not needed; change is to formatting and does not affect public API.
ivanperez-keera commentedon Oct 13, 2026
Change Manager: Implementation ready to be merged.
copilot-bluespec: Remove trailing spaces. Refs #775.
copilot-bluespec: Document changes in CHANGELOG. Refs #775.
Merge branch 'develop-trailing-spaces'. Close Copilot-Language#775.