I am attempting to add a rule to code linting that would require all of my functions to have a input parameters type specified. These are some different options I am able to compile:
function someName()
function someName(someParam)
function someName(someParam as int)
function someName(someParam = "" as int)
function someName(someParam = "")
function someName(someParam, otherParam)
function someName(someParam as int, otherParam)
function someName(someParam, otherParam as int)
function someName(someParam as int, otherParam as int)
But I want to match these as invalid:
function someName(someParam)
function someName(someParam = "")
function someName(someParam, otherParam)
function someName(someParam as int, otherParam)
function someName(someParam, otherParam as int)
So, I want all cases where any of input parameters not have as <some text> to be matched
In these examples, I can use:
function \w+\(.*Param(?! (= .*|)as \w+).*\)
but I cannot figure out how to make it work with any input parameter name
I am fine with multiple passes to match different invalid cases, as long as they do not match valid ones