Flake8 plugin that checks SQL code against opinionated style rules
Project description
Flake8-SQL is a flake8 plugin that looks for SQL queries and checks then against some opinionated styles. These styles mostly follow SQL Style Guide, but differ as detailed below.
Warnings
Q440 Keyword is not uppercase
All the SQL reserved keywords should be uppercase.
Q441 Name is not snake_case
All the non SQL keywords should be snake_case, which due to a limitation means simply that the word is lowercase.
Q442 Avoid abbreviated keywords
Avoid using abbreviated keywords instead use the full length version.
Q443 Incorrect whitespace around comma
Commas should be followed by whitespace, but not preceded.
Q444 Incorrect whitespace around equals
Equals should be surrounded with whitespace.
Q445 Missing linespace between phrases
The phrases SELECT, FROM, INSERT INTO, VALUES, DELETE FROM, WHERE, UPDATE, and SET should be on separate lines (unless the entire query is on one line).
Q446 Missing newline after semicolon
Semicolons must be at the end of the line.
Limitations
String constants are sought out in the code and considered SQL if they contain select from, insert into values, update set or delete from in order. This may and is likely to lead to false positives, in which case simply add # noqa to have this plugin ignore the string.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for flake8_SQL-0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2185468f6ca6decf8f9934e47c80c36eb8ab873796402137f61793d1e093b55d |
|
MD5 | 2b11ba265e4a0e3da05588fdae9ebb13 |
|
BLAKE2b-256 | bf655066bd32121fb95699011e456da8efdb2602c5ec66eb498deea0d44a7184 |