Detects when compiler will throw unexpected parenthesis. If you are making a function call, do not insert spaces in between the function name and the opening parentheses.. Function calls with space between the function name and the parentheses cannot distinguish between function calls with parentheses, but with an accidental space before the ( and function calls without parentheses where the first positional argument is in parentheses.

Empty Parentheses


function ()

To fix the ambiguity remove the space or add outer parentheses without the space if the first argument should be ():

# extra space, no arguments to function
function()

# first argument is `()`
function(())

Keywords in Parentheses


function (key: value)

Keywords inside parentheses is not valid, so the only way to fix this is to remove the space

function(key: value)

Positional arguments in Parentheses


function (first_positional, second_positional)

A list of positional arguments in parentheses is not valid, so the only way to fix this is to remove the space

function(first_positional, second_positional)