Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flake8 issues #2393

Merged
merged 4 commits into from Jul 13, 2021
Merged

Fix flake8 issues #2393

merged 4 commits into from Jul 13, 2021

Conversation

lonvia
Copy link
Member

@lonvia lonvia commented Jul 13, 2021

This fixes code smells and potential security issues found by flake8/flake8-bugbear/flake8-bandit. The code smells mostly relate to code formatting. On the security side, the fixes provide more safe SQL command construction using psycopg2's sql module were possible. This brings us better quoting of variable and table names.

Altogether flake8 looks useful but has too many false positives to be suitable for CI integration. So it's rather something to run locally now and then.

Found by flake8.
Use psycopg2 formatting to ensure correct quoting.
Make psycopg2's convenience function accessible through
the cursor.
Use the SQL formatting supplied with psycopg whenever the
query needs to be put together from snippets.
@lonvia lonvia merged commit bc8b2d4 into osm-search:master Jul 13, 2021
@lonvia lonvia deleted the fix-flake8-issues branch July 13, 2021 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant