stripe / pg-schema-diff

Go library for diffing Postgres schemas and generating SQL migrations
MIT License
278 stars 20 forks source link

Fix Test Case Indent Formatting #67

Closed bplunkett-stripe closed 2 weeks ago

bplunkett-stripe commented 10 months ago

A lot of the test cases have inconsistent indenting formatting in the SQL. Some uses tabs, some use spaces. As a result, when this is rendered in github, some lines appear more indented than others.

To fix this, we will need to replace all test cases that have tabs indenting with a visual equivalent in spaces.

I'm guessing our go formatting didn't spot this because the SQL is contained within a string, which is presumably ignored by the formatter.

tanryberdi commented 10 months ago

/assign

bplunkett-stripe commented 10 months ago

I'm excited to have you take on this ticket @tanryberdi .

You can see an example of the problem here, where one column is inconsistently formatted. This problem is pervasive through the acceptance tests (the tests in that package).

Ideally, we should switch all of the tab formatting to spaces, since spaces will be always be consistently rendered. It would also be nice if we can find a way to enforce that in CI, but I doubt it's possible since the SQL is located in a go string literal.

Feel free to ping me with any questions you have on this ticket!