After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 770564 - Add unscrustify config and run it on Nautilus code
Add unscrustify config and run it on Nautilus code
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-08-29 16:35 UTC by Carlos Soriano
Modified: 2016-09-06 13:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
general: add uncrustify script (22.97 KB, patch)
2016-08-29 16:36 UTC, Carlos Soriano
committed Details | Review
general: adjust uncrustify style (13.03 KB, patch)
2016-09-06 13:00 UTC, Carlos Soriano
committed Details | Review
general: rerun uncrustify in compress-dialog-controller (1.77 KB, patch)
2016-09-06 13:34 UTC, Carlos Soriano
committed Details | Review
file-name-widget-controller: rerun uncrustify (2.42 KB, patch)
2016-09-06 13:35 UTC, Carlos Soriano
committed Details | Review

Description Carlos Soriano 2016-08-29 16:35:56 UTC
We have been wanting to do this for long time... Adding this bug as reference in case someone has some concern, problem with it or doubt.
Comment 1 Carlos Soriano 2016-08-29 16:36:01 UTC
Created attachment 334385 [details] [review]
general: add uncrustify script

The current style of nautilus is rather poor and mixes at least 3
different code styles.

Specific issues that affect the most common contributors to Nautilus
performance are:
- tabs for multiline alignment.
- mix of tabs and spaces.
- errors on no braced one liners conditionals.
- errors on non braced case statements with variable declarations.

So I would say requirements for the style is to address the previous
issues and also be a well known style. I don't want new contributors
to see a new style completely different from C books authors.

So far, I found Allman (aka BSD) style which seems the choice of most C
books authors as far as I can see on internet, and it address the
previous mentioned issues.

Since uncrustify doesn't support the aligment of parameters we do for
multiple stars "**", we also added a script made by Sebastian Wilmet
to align those.

As a matter of practicity I'm going to convert all Nautilus style to
this one, and if the next person who contributes most on Nautilus has
a different choice, please feel free to change it to whatever makes your
performance and your contributors performance the best.
Comment 2 Carlos Soriano 2016-08-29 16:38:13 UTC
Feel free to direct your concern/questions here

Attachment 334385 [details] pushed as 4cafccd - general: add uncrustify script
Comment 3 Carlos Soriano 2016-09-06 13:00:05 UTC
Created attachment 334901 [details] [review]
general: adjust uncrustify style
Comment 4 Carlos Soriano 2016-09-06 13:34:25 UTC
Created attachment 334903 [details] [review]
general: rerun uncrustify in compress-dialog-controller

Seems the case statements adjustment are buggy in uncrustify.
Added a new line at the start of the file, reran uncrustify and it
worked. Removing the new line doesn't affect the output anymore.
Comment 5 Carlos Soriano 2016-09-06 13:35:01 UTC
Created attachment 334905 [details] [review]
file-name-widget-controller: rerun uncrustify
Comment 6 Carlos Soriano 2016-09-06 13:41:44 UTC
Attachment 334901 [details] pushed as 0abaab1 - general: adjust uncrustify style
Attachment 334903 [details] pushed as 24ced54 - general: rerun uncrustify in compress-dialog-controller
Attachment 334905 [details] pushed as 995fad6 - file-name-widget-controller: rerun uncrustify