3 ms·
Every formatter I know errors out if the file is syntactically invalid.
by xigoi 5y ago
Every formatter I know errors out if the file is syntactically invalid.
- awild 5y agoThis isn't about syntactical errors, per se. One example I can remember was an empty if or for loop body where everything beyond it was raised into its scope. I'm taking about pycharm formatter specifically here. This does also happen with braces sometimes, but this would've simply been a syntax error in most other languages or just pulled up the single next line not the entire following code.
- xigoi 5y agoIf you write something like this: if foo: bar That's a syntax error, and a good formatter won't do anything about it. If PyCharm's formatter changes it, I wouldn't use it.