Opened 8 years ago

Closed 8 years ago

#3767 closed defect (fixed)

SQL file indentations are mixed

Reported by: robe Owned by: strk
Priority: low Milestone: PostGIS 2.4.0
Component: postgis Version: master
Keywords: Cc:

Description (last modified by robe)

On the postgis.sql.in we've got a mix of tabs and spaces

rtpostgis.sql.in and geography.sql.in are mostly tab spaced. topology is mostly spaces I think.

and then we've got true .sql files.

I think sql.in and .sql should have the same indentation.

I prefer tabs.

Should standardize and editorconfig should be updated to reflect

Change History (11)

comment:1 by robe, 8 years ago

Description: modified (diff)
Owner: changed from pramsey to strk

comment:2 by strk, 8 years ago

In 15410:

Topology SQL files want space indent

See #3767

comment:3 by strk, 8 years ago

I used spaces for all topology code, the good thing is that Editorconfig can be told what to use where. So, are tabs consistent under postgis/ ? I forgot what tool I used last time to detect…

comment:4 by strk, 8 years ago

Maybe this is useful to add the missing bits: https://yarnpkg.com/en/package/indent-style

comment:5 by komzpa, 8 years ago

DataGrip (https://www.jetbrains.com/datagrip/download/#section=linux) has a good SQL formatter. There are 30-day trial, and the EAP build is free. Hope this helps to format PostGIS is stable way.

(I prefer 4 spaces and lowercase :)

comment:6 by robe, 8 years ago

Yes \postgis, \raster the .c and .sql.in are predominantly tabs, but a lot of files where it's a little mixed. Looks like perl and sh are mostly spaces.

\postgis\sfcgal.sql.in is mostly spaces with one part being tabs.

postgis.sql.in is mostly tabs, though it looks like in place where it's spaces is mostly my doing :(.

@komzpa, are you trying to start a fight? We've got enough trouble with spaces and tabs without having to introduce 4 spaces and lowercase. Though admittedly if we are going to settle on spaces, I do find 4 spaces easier to read than 2. :)

comment:7 by strk, 8 years ago

In 15413:

Request tab indentation by default for SQL files

Still keep sfcgal.sql and topology SQL files with spaces, to
reflect the current state.

See #3767

comment:8 by strk, 8 years ago

Good thing about tabs is you choose what you prefer visually. Good thing about spaces is 80 cols are the same for everybody.

Every choice is a loss. Let's not choose ! :)

Now (and I'm serious) here I'd only want to make it easier for people with a working editorconfig setup (you all do have this right ?) to not add more entropy, so see how you like r15413

One day we might be able to accept the loss and update editorconfig accordingly.

comment:9 by robe, 8 years ago

Okay I have installed editorconfig for visual code and will use that from now on for editing PostGIS files. Can we close this out?

comment:10 by strk, 8 years ago

You are the reporter, you decide when it's time to close it. Indent styles are still mixed, but we institutionalized the mix now :)

comment:11 by robe, 8 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.