question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

False negative with statement ending with parens

See original GitHub issue
if (foo and
    bar()):
    pass

I expect to be rewritten to

if (
    foo and
    bar()
):
    pass

But I imagine the same code that prevents this from being rewritten is firing:

foo('bar {}'.format(
    'baz',
))

which I don’t think should be rewritten.

Need to come up with a more clever heuristic here.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
smagafurovcommented, Oct 18, 2018

Very sorry for my inattention. I did not notice that you are the author of the tool. 😃 Sorry one more time… And thank for the tool!

0reactions
smagafurovcommented, Oct 18, 2018

PyCharm Reformat Code works exactly that way i want https://www.jetbrains.com/help/pycharm/reformatting-source-code.html

Please stop

ok

Read more comments on GitHub >

github_iconTop Results From Across the Web

Different Results With Parentheses and Variable Placement in ...
I was under the impression that the placement of the variable in this conditional if statement didn't matter if I was using the...
Read more >
Logical Connectives
A statement is a declarative sentence that can be either true or false. Remark. Many real proofs contain things which aren't really statements...
Read more >
What is the logical negation symbol? - TechTarget
The logical negation symbol is used in Boolean algebra to indicate that the truth value of the statement that follows is reversed. Learn...
Read more >
Check if given Parentheses expression is balanced or not
If Count becomes negative at any point, then expression is said to be not balanced, so mark Flag as false and break from...
Read more >
A Study of False-Positive and False-Negative Error Rates in ...
Conclusions: One of the goals of this project was determination of a false-negative rate for cartridge case comparisons.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found