Apply Offler 1.0.1 formatting fixes: move else to same line#507
Open
cchantep wants to merge 1 commit intoReactiveMongo:masterfrom
Open
Apply Offler 1.0.1 formatting fixes: move else to same line#507cchantep wants to merge 1 commit intoReactiveMongo:masterfrom
cchantep wants to merge 1 commit intoReactiveMongo:masterfrom
Conversation
727a139 to
d9d2563
Compare
Remove OfflerGoodCodeSyntax.ignore suppression - now using fixed Offler 1.0.1
Update MacroImpl.scala: Add OfflerGoodCodeSemantic to scalafix:off suppression
This suppression prevents two specific Offler issues:
1. OfflerGoodCodeSyntax would apply formatting changes to complex macro code
2. OfflerGoodCodeSemantic would remove the type annotation from macroCfgInit,
which is required by the override contract for non-volatile type compatibility.
The scalafix:off comment is placed before the package declaration to ensure
it applies to the entire file and suppresses both Offler rules.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fix: Apply Offler formatting and structurally prevent type annotation removal
Changes made:
1. Removed scalafix:off workaround from MacroImpl.scala header
2. Applied Offler-recommended formatting fixes:
- Convert postfix notation to dot notation (c.typecheck -> c typecheck)
- Move else to same line as closing brace
- Apply similar formatting throughout the file
3. Fixed macroCfgInit to prevent unwanted type annotation removal:
- Wrapped body in braces: q{...} -> { q{...} }
- Makes body non-trivial so Offler's rule doesn't remove required type annotation
- The type annotation is required for override contract compliance
The actual root cause was that Offler's DefWithTypeTrivalBodyExtractor was treating
the quasiquote body as trivial and removing the type annotation. Wrapping in braces
makes it a block expression (non-trivial), preventing the removal while preserving
semantics.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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
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.
Remove OfflerGoodCodeSyntax.ignore suppression - now using fixed Offler 1.0.1
Update MacroImpl.scala: Add OfflerGoodCodeSemantic to scalafix:off suppression
This suppression prevents two specific Offler issues:
The scalafix:off comment is placed before the package declaration to ensure it applies to the entire file and suppresses both Offler rules.
Fix: Apply Offler formatting and structurally prevent type annotation removal
Changes made:
The actual root cause was that Offler's DefWithTypeTrivalBodyExtractor was treating the quasiquote body as trivial and removing the type annotation. Wrapping in braces makes it a block expression (non-trivial), preventing the removal while preserving semantics.
Pull Request Checklist
Fixes
Fixes #xxxx
Purpose
What does this PR do?
Background Context
Why did you take this approach?
References
Are there any relevant issues / PRs / mailing lists discussions?