aboutsummaryrefslogtreecommitdiff
path: root/nexgb/STYLE
diff options
context:
space:
mode:
authorPřemysl Janouch <p@janouch.name>2018-09-08 16:54:17 +0200
committerPřemysl Janouch <p@janouch.name>2018-09-08 16:54:17 +0200
commit3173202cc1e08762c6e156a8fffd23269a5ddb2b (patch)
tree95c4a06f8384d41b15e9c22afac0a387de79dc51 /nexgb/STYLE
parent632b3ae494d45755525644fe5d04475c95aae364 (diff)
parent3906399e7c2a40fbaf355de572cf50a314083f64 (diff)
downloadhaven-3173202cc1e08762c6e156a8fffd23269a5ddb2b.tar.gz
haven-3173202cc1e08762c6e156a8fffd23269a5ddb2b.tar.xz
haven-3173202cc1e08762c6e156a8fffd23269a5ddb2b.zip
Merge aarzilli/xgb, branch xcb1.12 as nexgb
History has been linearized and rewritten to stay under the new subdirectory. I want to make changes incompatible to BurntSushi/xgb. The history begs for being thrown away entirely because of its quality and because it doesn't cover the Google period but it is still useful for copyright tracking.
Diffstat (limited to 'nexgb/STYLE')
-rw-r--r--nexgb/STYLE29
1 files changed, 29 insertions, 0 deletions
diff --git a/nexgb/STYLE b/nexgb/STYLE
new file mode 100644
index 0000000..b827c3c
--- /dev/null
+++ b/nexgb/STYLE
@@ -0,0 +1,29 @@
+I like to keep all my code to 80 columns or less. I have plenty of screen real
+estate, but enjoy 80 columns so that I can have multiple code windows open side
+to side and not be plagued by the ugly auto-wrapping of a text editor.
+
+If you don't oblige me, I will fix any patch you submit to abide 80 columns.
+
+Note that this style restriction does not preclude gofmt, but introduces a few
+peculiarities. The first is that gofmt will occasionally add spacing (typically
+to comments) that ends up going over 80 columns. Either shorten the comment or
+put it on its own line.
+
+The second and more common hiccup is when a function definition extends beyond
+80 columns. If one adds line breaks to keep it below 80 columns, gofmt will
+indent all subsequent lines in a function definition to the same indentation
+level of the function body. This results in a less-than-ideal separation
+between function definition and function body. To remedy this, simply add a
+line break like so:
+
+ func RestackWindowExtra(xu *xgbutil.XUtil, win xproto.Window, stackMode int,
+ sibling xproto.Window, source int) error {
+
+ return ClientEvent(xu, win, "_NET_RESTACK_WINDOW", source, int(sibling),
+ stackMode)
+ }
+
+Something similar should also be applied to long 'if' or 'for' conditionals,
+although it would probably be preferrable to break up the conditional to
+smaller chunks with a few helper variables.
+