felipebz / zpa

Parser and static code analysis tool for PL/SQL and Oracle SQL.
https://zpa.felipebz.com
GNU Lesser General Public License v3.0
211 stars 77 forks source link

creating a rule for all reserved words #144

Closed tplazaro closed 3 years ago

tplazaro commented 3 years ago

Hi - is there a way to parse all reserved words and create a custom rule out of it? For example, all keywords should be in uppercase. Thank you!

l0wlik34G6 commented 3 years ago

What we did once was creating a list of all the reserved words and checking if the current token is in this list. If so, add the issue. But I don't know if there is a better way.

It might depend on your version, but we took the list from the oracle doc: https://docs.oracle.com/en/database/oracle/oracle-database/21/lnpls/plsql-reserved-words-keywords.html

tplazaro commented 3 years ago

thanks for the suggestion!