SYNG3006 - Replacement causes syntax error
Domain: ops
Severity: USER
A replacement would produce invalid syntax in the target file.
After applying the replacement, the resulting code would have syntax errors. SYNG validates replacements to prevent breaking your code.
Example
clojure
(:replace (str) "")Replacing the string with empty text would produce print() which may be valid, but replacing in a context like x = "hello" would produce x = which is a syntax error.
Solution
Adjust your replacement to produce valid syntax:
- Check that the replacement text is syntactically valid in context
- Consider whether you need to replace a larger node to maintain validity
- Use
--forceto apply replacements anyway (at your own risk)
The error message will indicate which specific replacement caused the syntax error.