Open Kampfkarren opened 2 years ago
@Kampfkarren, considering the given PR (#442), could you kindly set a review over it? It seems that might be we are missing the fact that Math.random
could be also called without any parameter for generating a pseudorandom floating point number as mentioned in the Lua Documentation.
This isn't quite what I meant. math.random()
is fine, math.random(5)
is fine, and math.random(2, 5)
is fine, but math.random(1, 5)
is the same as math.random(5)
, and should be linted as such.
I suspect you're going through "good first issue", which is great! This one is gonna be more complicated than the other two--it's a good introduction if you want to get into writing lints and traversing ASTs, but is not trivial.
By setting a review on the given documentation and current rules files, I got to the conclusion that an if_chain
should be created with the following elements:
Thank you for sharing this content with me and helping me to get into development of this application. I would take a more in-depth view and local experimentation before proposing further solutions.
That's correct, with the extra edge case of making sure the user doesn't define math
. You can do this with the ScopeManager utility, look around for how that's done for other lints.
More concise.