Skip to content

Conversation

stropysh
Copy link

@stropysh stropysh commented Mar 13, 2025

Fixing issue #801. Format remove all the comments with strip_comments when there are only comments in a line.

Before submitting your pull request please have a look at the
following checklist:

  • ran the tests (pytest)
  • all style issues addressed (flake8)
  • your changes are covered by tests
  • your changes are documented, if needed

For example, as it now, if execute this code:

query = "--A;\n--B;"
result = sqlparse.format(query, strip_comments=True)

result is --B

After fix - empy line

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.

1 participant