#3538 closed defect (wontfix)
Enforcing code style
Reported by: | strk | Owned by: | pramsey |
---|---|---|---|
Priority: | medium | Milestone: | Website Management, Bots |
Component: | postgis | Version: | 2.2.x |
Keywords: | Cc: |
Description
Follow up to #433
At the moment (r14869) we are _requiring_ astyle 1.23 but Ubuntu 14.04 (2 years ago) ships 2.03. Time to change ?
I've pushed an "astyle" branch to the git repository at https://git.osgeo.org/gogs/postgis/postgis.git
The branch was styled with astyle 2.03 on ubuntu 14.04 and the check for astyle version was removed from the astyle.sh script.
Could you please report here the effects of "make astyle" with your version of astyle on your system ? If we can all run astyle in a consistent way we could build some automation for developers to enforce it.
Change History (8)
comment:1 by , 9 years ago
comment:2 by , 9 years ago
I think I like mine better
diff --git a/liblwgeom/lwgeom.c b/liblwgeom/lwgeom.c index da9dc2a..7461332 100644 --- a/liblwgeom/lwgeom.c +++ b/liblwgeom/lwgeom.c @@ -48,8 +48,8 @@ lwgeom_force_clockwise(LWGEOM *lwgeom) lwtriangle_force_clockwise((LWTRIANGLE *)lwgeom); return; - /* Not handle POLYHEDRALSURFACE and TIN - as they are supposed to be well oriented */ + /* Not handle POLYHEDRALSURFACE and TIN + as they are supposed to be well oriented */ case MULTIPOLYGONTYPE: case COLLECTIONTYPE: coll = (LWCOLLECTION *)lwgeom;
comment:3 by , 9 years ago
Except for the handling of enum, which gets worse
diff --git a/postgis/lwgeom_in_kml.c b/postgis/lwgeom_in_kml.c index cedeb3a..930aaa6 100644 --- a/postgis/lwgeom_in_kml.c +++ b/postgis/lwgeom_in_kml.c @@ -209,15 +209,15 @@ static double parse_kml_double(char *d, bool space_before, int st; enum states { - INIT = 0, - NEED_DIG = 1, - DIG = 2, - NEED_DIG_DEC = 3, - DIG_DEC = 4, - EXP = 5, - NEED_DIG_EXP = 6, - DIG_EXP = 7, - END = 8 + INIT = 0, + NEED_DIG = 1, + DIG = 2, + NEED_DIG_DEC = 3, + DIG_DEC = 4, + EXP = 5, + NEED_DIG_EXP = 6, + DIG_EXP = 7, + END = 8 };
comment:4 by , 9 years ago
In any case, there's still no "stable" output from astyle, so we'd better look for something different if we want to go there.
Maybe we could try the qgis one, which sounds pretty complex: https://github.com/qgis/QGIS/blob/master/scripts/astyle.sh
comment:5 by , 9 years ago
I think we should just have an astyle pass over the whole code base, and then go back to ruining it for another 5 years.
comment:6 by , 9 years ago
I got confirmation by Jurgen that QGIS basically ships a specific version of astyle (includes its source code within the qgis one).
How about that solution ?
comment:7 by , 7 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
seems like we're in more of a slow burn with editorconfig than a bulk change
Huh, not super