Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle files that begin with comments in PrivateNamingConvention
After trying out this new rule, I noticed a couple of bugs. Both are related, and one caused a crash. They both happen when the file begins with a comment. For some reason, if the file starts with a comment, the engine seems to visit the function usage twice, once before it visits the function definition, and once after. Since we are relying on the order that these things are visited here, this causes a lint to happen. But even worse, when visiting a variable within a for loop, the node has no source range, which causes a crash. This only seems to happen when the file begins with a comment. I fixed these by making sure that things have a source range before we determine their position, and by also checking the top level even though we really shouldn't need to.
- Loading branch information