Re: lions, tabs, spaces, bears



On Fri, 2008-11-28 at 15:26 -0500, Colin Walters wrote:
> Short version: I have unilaterally converted all the JS to be 4
> spaces, no tabs and added the requisite Emacs magic for non-js2-mode,
> as well as Eclipse bits.
> 
> Long version: I finally noticed that since I wasn't using js2-mode, my
> code was using 8-space tabs.  Other code was using 4-spaces.  There
> were other style variations too; anyways it was best described as a
> total disaster.

Sideshow.prototype = {
-    _init : function(width) {
-       let me = this;
+_init : function(width) {
+    let me = this;

Wow, big indentation change. If we're going differ from the gjs style
guide like this, we probably need style page under
live.gnome.org/GnomeShell to document the differences.

In a lot of places it looks like hand indentation got replaced by
automated indentation. A couple of examples:

-       this._grid = new Tidy.Grid({ height: TRAY_HEIGHT,
-                                    valign: 0.5,
-                                    end_align: true,
-                                    column_gap: 2 })
+    this._grid = new Tidy.Grid({ height: TRAY_HEIGHT,
+        valign: 0.5,
+        end_align: true,
+        column_gap: 2 })

Or:

-       let struts = [
-            new Meta.Strut({
-               rect: {
-                   x: 0,
-                   y: 0,
-                   width: global.screen_width,
-                   height: PANEL_HEIGHT
-               },
-               side: Meta.Direction.TOP
-           })
-       ];
+    let struts = [
+                  new Meta.Strut({
+                      rect: {
+                      x: 0,
+                      y: 0,
+                      width: global.screen_width,
+                      height: PANEL_HEIGHT
+                  },
+                  side: Meta.Direction.TOP
+                  })
+                  ];

And in appdispay.js, you seem to have 8 space indents:

_removeAll: function() {
        for (appid in this._displayed)
                this._removeItem(appid);
},

at least mostly.

- Owen




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]