Skip to content

Conversation

@stropysh
Copy link
Contributor

@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

@andialbrecht andialbrecht merged commit 73c8ba3 into andialbrecht:master Nov 27, 2025
@andialbrecht
Copy link
Owner

woah! Nice catch! Thank you!

@andialbrecht andialbrecht added this to the 0.5.4 milestone Nov 27, 2025
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.

2 participants