tinyos / nesc

Master nesc repository
GNU General Public License v2.0
100 stars 53 forks source link

Converted tabs to spaces #11

Closed bradjc closed 6 years ago

bradjc commented 11 years ago

Many 8-wide tab characters were mixed in with spaces for indents. This changes all of the tabs to spaces so the formatting is consistent across text editors.

Not sure if anyone cares, but this makes it easier for me to look at the code.

dgay42 commented 11 years ago

On 2013-05-06 18:49, Brad Campbell wrote:

Many 8-wide tab characters were mixed in with spaces for indents. This changes all of the tabs to spaces so the formatting is consistent across text editors.

Not sure if anyone cares, but this makes it easier for me to look at the code.

The issue here is whether we then all stick to consistently using spaces only (in particular, emacs's default configuration is to use tabs to fill whitespace, with tabs set at the standard value of every 8 spaces).

David


YOU CAN MERGE THIS PULL REQUEST BY RUNNING

git pull https://github.com/lab11/nesc tabs-to-spaces

Or view, comment on, or merge it at:

https://github.com/tinyos/nesc/pull/11 [1]

COMMIT SUMMARY

  • Converted tabs to spaces

FILE CHANGES

  • M src/AST.c 2
  • M src/AST.h 3
  • M src/AST_utils.c 4
  • M src/AST_walk.c 5
  • M src/AST_walk.h 6
  • M src/array.c 7
  • M src/array.h 8
  • M src/attributes.c 9
  • M src/c-lex-state.h 10
  • M src/c-lex.c 11
  • M src/c-lex.h 12
  • M src/constants.c 13
  • M src/constants.h 14
  • M src/cval.c 15
  • M src/cval.h 16
  • M src/dd_list.h 17
  • M src/decls.h 18
  • M src/dhash.c 19
  • M src/dhash.h 20
  • M src/edit.c 21
  • M src/edit.h 22
  • M src/env.c 23
  • M src/errors.c 24
  • M src/errors.h 25
  • M src/expr.c 26
  • M src/expr.h 27
  • M src/graph.c 28
  • M src/graph.h 29
  • M src/init.c 30
  • M src/init.h 31
  • M src/libcompat/alloc.c 32
  • M src/libcompat/fnmatch.c 33
  • M src/libcompat/fnmatch/fnmatch.h 34
  • M src/libcompat/fnmatch_loop.c 35
  • M src/libcompat/naive.c 36
  • M src/libcompat/pages.c 37
  • M src/libcompat/regex.c 38
  • M src/libcompat/regex/regex.h 39
  • M src/libcompat/regions.c 40
  • M src/libcompat/stats.c 41
  • M src/machine.c 42
  • M src/machine.h 43
  • M src/machine/avr.c 44
  • M src/machine/env_machine.c 45
  • M src/machine/keil.c 46
  • M src/machine/msp430.c 47
  • M src/machine/sdcc.c 48
  • M src/machine/self.c 49
  • M src/nesc-abstract.c 50
  • M src/nesc-abstract.h 51
  • M src/nesc-atomic.c 52
  • M src/nesc-attributes.c 53
  • M src/nesc-attributes.h 54
  • M src/nesc-component.c 55
  • M src/nesc-component.h 56
  • M src/nesc-concurrency.c 57
  • M src/nesc-configuration.c 58
  • M src/nesc-configuration.h 59
  • M src/nesc-constants.c 60
  • M src/nesc-cpp.c 61
  • M src/nesc-decls.h 62
  • M src/nesc-deputy.c 63
  • M src/nesc-dfilter.c 64
  • M src/nesc-doc.c 65
  • M src/nesc-dump.c 66
  • M src/nesc-dump.h 67
  • M src/nesc-env.c 68
  • M src/nesc-env.h 69
  • M src/nesc-gcc.c 70
  • M src/nesc-generate.c 71
  • M src/nesc-generate.h 72
  • M src/nesc-inline.c 73
  • M src/nesc-magic.c 74
  • M src/nesc-main.c 75
  • M src/nesc-module.c 76
  • M src/nesc-msg.c 77
  • M src/nesc-ndoc.c 78
  • M src/nesc-ndoc.h 79
  • M src/nesc-network.c 80
  • M src/nesc-paths.c 81
  • M src/nesc-semantics.c 82
  • M src/nesc-semantics.h 83
  • M src/nesc-task.c 84
  • M src/nesc-uses.c 85
  • M src/nesc-uses.h 86
  • M src/nesc-xml.c 87
  • M src/qualifiers.h 88
  • M src/semantics.c 89
  • M src/semantics.h 90
  • M src/stmt.c 91
  • M src/toplev.c 92
  • M src/types.c 93
  • M src/types.h 94
  • M src/unparse.c 95
  • M src/unparse.h 96
  • M src/utils.c 97

PATCH LINKS:

Links:

[1] https://github.com/tinyos/nesc/pull/11 [2] https://github.com/tinyos/nesc/pull/11/files#diff-0 [3] https://github.com/tinyos/nesc/pull/11/files#diff-1 [4] https://github.com/tinyos/nesc/pull/11/files#diff-2 [5] https://github.com/tinyos/nesc/pull/11/files#diff-3 [6] https://github.com/tinyos/nesc/pull/11/files#diff-4 [7] https://github.com/tinyos/nesc/pull/11/files#diff-5 [8] https://github.com/tinyos/nesc/pull/11/files#diff-6 [9] https://github.com/tinyos/nesc/pull/11/files#diff-7 [10] https://github.com/tinyos/nesc/pull/11/files#diff-8 [11] https://github.com/tinyos/nesc/pull/11/files#diff-9 [12] https://github.com/tinyos/nesc/pull/11/files#diff-10 [13] https://github.com/tinyos/nesc/pull/11/files#diff-11 [14] https://github.com/tinyos/nesc/pull/11/files#diff-12 [15] https://github.com/tinyos/nesc/pull/11/files#diff-13 [16] https://github.com/tinyos/nesc/pull/11/files#diff-14 [17] https://github.com/tinyos/nesc/pull/11/files#diff-15 [18] https://github.com/tinyos/nesc/pull/11/files#diff-16 [19] https://github.com/tinyos/nesc/pull/11/files#diff-17 [20] https://github.com/tinyos/nesc/pull/11/files#diff-18 [21] https://github.com/tinyos/nesc/pull/11/files#diff-19 [22] https://github.com/tinyos/nesc/pull/11/files#diff-20 [23] https://github.com/tinyos/nesc/pull/11/files#diff-21 [24] https://github.com/tinyos/nesc/pull/11/files#diff-22 [25] https://github.com/tinyos/nesc/pull/11/files#diff-23 [26] https://github.com/tinyos/nesc/pull/11/files#diff-24 [27] https://github.com/tinyos/nesc/pull/11/files#diff-25 [28] https://github.com/tinyos/nesc/pull/11/files#diff-26 [29] https://github.com/tinyos/nesc/pull/11/files#diff-27 [30] https://github.com/tinyos/nesc/pull/11/files#diff-28 [31] https://github.com/tinyos/nesc/pull/11/files#diff-29 [32] https://github.com/tinyos/nesc/pull/11/files#diff-30 [33] https://github.com/tinyos/nesc/pull/11/files#diff-31 [34] https://github.com/tinyos/nesc/pull/11/files#diff-32 [35] https://github.com/tinyos/nesc/pull/11/files#diff-33 [36] https://github.com/tinyos/nesc/pull/11/files#diff-34 [37] https://github.com/tinyos/nesc/pull/11/files#diff-35 [38] https://github.com/tinyos/nesc/pull/11/files#diff-36 [39] https://github.com/tinyos/nesc/pull/11/files#diff-37 [40] https://github.com/tinyos/nesc/pull/11/files#diff-38 [41] https://github.com/tinyos/nesc/pull/11/files#diff-39 [42] https://github.com/tinyos/nesc/pull/11/files#diff-40 [43] https://github.com/tinyos/nesc/pull/11/files#diff-41 [44] https://github.com/tinyos/nesc/pull/11/files#diff-42 [45] https://github.com/tinyos/nesc/pull/11/files#diff-43 [46] https://github.com/tinyos/nesc/pull/11/files#diff-44 [47] https://github.com/tinyos/nesc/pull/11/files#diff-45 [48] https://github.com/tinyos/nesc/pull/11/files#diff-46 [49] https://github.com/tinyos/nesc/pull/11/files#diff-47 [50] https://github.com/tinyos/nesc/pull/11/files#diff-48 [51] https://github.com/tinyos/nesc/pull/11/files#diff-49 [52] https://github.com/tinyos/nesc/pull/11/files#diff-50 [53] https://github.com/tinyos/nesc/pull/11/files#diff-51 [54] https://github.com/tinyos/nesc/pull/11/files#diff-52 [55] https://github.com/tinyos/nesc/pull/11/files#diff-53 [56] https://github.com/tinyos/nesc/pull/11/files#diff-54 [57] https://github.com/tinyos/nesc/pull/11/files#diff-55 [58] https://github.com/tinyos/nesc/pull/11/files#diff-56 [59] https://github.com/tinyos/nesc/pull/11/files#diff-57 [60] https://github.com/tinyos/nesc/pull/11/files#diff-58 [61] https://github.com/tinyos/nesc/pull/11/files#diff-59 [62] https://github.com/tinyos/nesc/pull/11/files#diff-60 [63] https://github.com/tinyos/nesc/pull/11/files#diff-61 [64] https://github.com/tinyos/nesc/pull/11/files#diff-62 [65] https://github.com/tinyos/nesc/pull/11/files#diff-63 [66] https://github.com/tinyos/nesc/pull/11/files#diff-64 [67] https://github.com/tinyos/nesc/pull/11/files#diff-65 [68] https://github.com/tinyos/nesc/pull/11/files#diff-66 [69] https://github.com/tinyos/nesc/pull/11/files#diff-67 [70] https://github.com/tinyos/nesc/pull/11/files#diff-68 [71] https://github.com/tinyos/nesc/pull/11/files#diff-69 [72] https://github.com/tinyos/nesc/pull/11/files#diff-70 [73] https://github.com/tinyos/nesc/pull/11/files#diff-71 [74] https://github.com/tinyos/nesc/pull/11/files#diff-72 [75] https://github.com/tinyos/nesc/pull/11/files#diff-73 [76] https://github.com/tinyos/nesc/pull/11/files#diff-74 [77] https://github.com/tinyos/nesc/pull/11/files#diff-75 [78] https://github.com/tinyos/nesc/pull/11/files#diff-76 [79] https://github.com/tinyos/nesc/pull/11/files#diff-77 [80] https://github.com/tinyos/nesc/pull/11/files#diff-78 [81] https://github.com/tinyos/nesc/pull/11/files#diff-79 [82] https://github.com/tinyos/nesc/pull/11/files#diff-80 [83] https://github.com/tinyos/nesc/pull/11/files#diff-81 [84] https://github.com/tinyos/nesc/pull/11/files#diff-82 [85] https://github.com/tinyos/nesc/pull/11/files#diff-83 [86] https://github.com/tinyos/nesc/pull/11/files#diff-84 [87] https://github.com/tinyos/nesc/pull/11/files#diff-85 [88] https://github.com/tinyos/nesc/pull/11/files#diff-86 [89] https://github.com/tinyos/nesc/pull/11/files#diff-87 [90] https://github.com/tinyos/nesc/pull/11/files#diff-88 [91] https://github.com/tinyos/nesc/pull/11/files#diff-89 [92] https://github.com/tinyos/nesc/pull/11/files#diff-90 [93] https://github.com/tinyos/nesc/pull/11/files#diff-91 [94] https://github.com/tinyos/nesc/pull/11/files#diff-92 [95] https://github.com/tinyos/nesc/pull/11/files#diff-93 [96] https://github.com/tinyos/nesc/pull/11/files#diff-94 [97] https://github.com/tinyos/nesc/pull/11/files#diff-95 [98] https://github.com/tinyos/nesc/pull/11.patch [99] https://github.com/tinyos/nesc/pull/11.diff

cire831 commented 11 years ago

I tend to leave white space things alone. That way when we look at a commit we only see the changes.

But I've been sorely tempted at times to clean up some really horrific looking code. But eventually it just wasn't worth the pain.

For nesc (and C) code I've adopted the minimal 2 space indent and let Emacs handle it.

Using just spaces won't fly very long as David and I both use Emacs with tabs at 8. Tabs come first then spaces for what < 8 is needed.

There is a coding standard attempt at specification at the tail end of https://github.com/tinyos/tinyos-main/blob/master/doc/00a_Getting_Started

On Mon, May 6, 2013 at 11:09 PM, dgay42 notifications@github.com wrote:

On 2013-05-06 18:49, Brad Campbell wrote:

Many 8-wide tab characters were mixed in with spaces for indents. This changes all of the tabs to spaces so the formatting is consistent across text editors.

Not sure if anyone cares, but this makes it easier for me to look at the code.

The issue here is whether we then all stick to consistently using spaces only (in particular, emacs's default configuration is to use tabs to fill whitespace, with tabs set at the standard value of every 8 spaces).

David


YOU CAN MERGE THIS PULL REQUEST BY RUNNING

git pull https://github.com/lab11/nesc tabs-to-spaces

Or view, comment on, or merge it at:

https://github.com/tinyos/nesc/pull/11 [1]

COMMIT SUMMARY

  • Converted tabs to spaces

FILE CHANGES

  • M src/AST.c 2
  • M src/AST.h 3
  • M src/AST_utils.c 4
  • M src/AST_walk.c 5
  • M src/AST_walk.h 6
  • M src/array.c 7
  • M src/array.h 8
  • M src/attributes.c 9
  • M src/c-lex-state.h 10
  • M src/c-lex.c 11
  • M src/c-lex.h 12
  • M src/constants.c 13
  • M src/constants.h 14
  • M src/cval.c 15
  • M src/cval.h 16
  • M src/dd_list.h 17
  • M src/decls.h 18
  • M src/dhash.c 19
  • M src/dhash.h 20
  • M src/edit.c 21
  • M src/edit.h 22
  • M src/env.c 23
  • M src/errors.c 24
  • M src/errors.h 25
  • M src/expr.c 26
  • M src/expr.h 27
  • M src/graph.c 28
  • M src/graph.h 29
  • M src/init.c 30
  • M src/init.h 31
  • M src/libcompat/alloc.c 32
  • M src/libcompat/fnmatch.c 33
  • M src/libcompat/fnmatch/fnmatch.h 34
  • M src/libcompat/fnmatch_loop.c 35
  • M src/libcompat/naive.c 36
  • M src/libcompat/pages.c 37
  • M src/libcompat/regex.c 38
  • M src/libcompat/regex/regex.h 39
  • M src/libcompat/regions.c 40
  • M src/libcompat/stats.c 41
  • M src/machine.c 42
  • M src/machine.h 43
  • M src/machine/avr.c 44
  • M src/machine/env_machine.c 45
  • M src/machine/keil.c 46
  • M src/machine/msp430.c 47
  • M src/machine/sdcc.c 48
  • M src/machine/self.c 49
  • M src/nesc-abstract.c 50
  • M src/nesc-abstract.h 51
  • M src/nesc-atomic.c 52
  • M src/nesc-attributes.c 53
  • M src/nesc-attributes.h 54
  • M src/nesc-component.c 55
  • M src/nesc-component.h 56
  • M src/nesc-concurrency.c 57
  • M src/nesc-configuration.c 58
  • M src/nesc-configuration.h 59
  • M src/nesc-constants.c 60
  • M src/nesc-cpp.c 61
  • M src/nesc-decls.h 62
  • M src/nesc-deputy.c 63
  • M src/nesc-dfilter.c 64
  • M src/nesc-doc.c 65
  • M src/nesc-dump.c 66
  • M src/nesc-dump.h 67
  • M src/nesc-env.c 68
  • M src/nesc-env.h 69
  • M src/nesc-gcc.c 70
  • M src/nesc-generate.c 71
  • M src/nesc-generate.h 72
  • M src/nesc-inline.c 73
  • M src/nesc-magic.c 74
  • M src/nesc-main.c 75
  • M src/nesc-module.c 76
  • M src/nesc-msg.c 77
  • M src/nesc-ndoc.c 78
  • M src/nesc-ndoc.h 79
  • M src/nesc-network.c 80
  • M src/nesc-paths.c 81
  • M src/nesc-semantics.c 82
  • M src/nesc-semantics.h 83
  • M src/nesc-task.c 84
  • M src/nesc-uses.c 85
  • M src/nesc-uses.h 86
  • M src/nesc-xml.c 87
  • M src/qualifiers.h 88
  • M src/semantics.c 89
  • M src/semantics.h 90
  • M src/stmt.c 91
  • M src/toplev.c 92
  • M src/types.c 93
  • M src/types.h 94
  • M src/unparse.c 95
  • M src/unparse.h 96
  • M src/utils.c 97

PATCH LINKS:

Links:

[1] https://github.com/tinyos/nesc/pull/11 [2] https://github.com/tinyos/nesc/pull/11/files#diff-0 [3] https://github.com/tinyos/nesc/pull/11/files#diff-1 [4] https://github.com/tinyos/nesc/pull/11/files#diff-2 [5] https://github.com/tinyos/nesc/pull/11/files#diff-3 [6] https://github.com/tinyos/nesc/pull/11/files#diff-4 [7] https://github.com/tinyos/nesc/pull/11/files#diff-5 [8] https://github.com/tinyos/nesc/pull/11/files#diff-6 [9] https://github.com/tinyos/nesc/pull/11/files#diff-7 [10] https://github.com/tinyos/nesc/pull/11/files#diff-8 [11] https://github.com/tinyos/nesc/pull/11/files#diff-9 [12] https://github.com/tinyos/nesc/pull/11/files#diff-10 [13] https://github.com/tinyos/nesc/pull/11/files#diff-11 [14] https://github.com/tinyos/nesc/pull/11/files#diff-12 [15] https://github.com/tinyos/nesc/pull/11/files#diff-13 [16] https://github.com/tinyos/nesc/pull/11/files#diff-14 [17] https://github.com/tinyos/nesc/pull/11/files#diff-15 [18] https://github.com/tinyos/nesc/pull/11/files#diff-16 [19] https://github.com/tinyos/nesc/pull/11/files#diff-17 [20] https://github.com/tinyos/nesc/pull/11/files#diff-18 [21] https://github.com/tinyos/nesc/pull/11/files#diff-19 [22] https://github.com/tinyos/nesc/pull/11/files#diff-20 [23] https://github.com/tinyos/nesc/pull/11/files#diff-21 [24] https://github.com/tinyos/nesc/pull/11/files#diff-22 [25] https://github.com/tinyos/nesc/pull/11/files#diff-23 [26] https://github.com/tinyos/nesc/pull/11/files#diff-24 [27] https://github.com/tinyos/nesc/pull/11/files#diff-25 [28] https://github.com/tinyos/nesc/pull/11/files#diff-26 [29] https://github.com/tinyos/nesc/pull/11/files#diff-27 [30] https://github.com/tinyos/nesc/pull/11/files#diff-28 [31] https://github.com/tinyos/nesc/pull/11/files#diff-29 [32] https://github.com/tinyos/nesc/pull/11/files#diff-30 [33] https://github.com/tinyos/nesc/pull/11/files#diff-31 [34] https://github.com/tinyos/nesc/pull/11/files#diff-32 [35] https://github.com/tinyos/nesc/pull/11/files#diff-33 [36] https://github.com/tinyos/nesc/pull/11/files#diff-34 [37] https://github.com/tinyos/nesc/pull/11/files#diff-35 [38] https://github.com/tinyos/nesc/pull/11/files#diff-36 [39] https://github.com/tinyos/nesc/pull/11/files#diff-37 [40] https://github.com/tinyos/nesc/pull/11/files#diff-38 [41] https://github.com/tinyos/nesc/pull/11/files#diff-39 [42] https://github.com/tinyos/nesc/pull/11/files#diff-40 [43] https://github.com/tinyos/nesc/pull/11/files#diff-41 [44] https://github.com/tinyos/nesc/pull/11/files#diff-42 [45] https://github.com/tinyos/nesc/pull/11/files#diff-43 [46] https://github.com/tinyos/nesc/pull/11/files#diff-44 [47] https://github.com/tinyos/nesc/pull/11/files#diff-45 [48] https://github.com/tinyos/nesc/pull/11/files#diff-46 [49] https://github.com/tinyos/nesc/pull/11/files#diff-47 [50] https://github.com/tinyos/nesc/pull/11/files#diff-48 [51] https://github.com/tinyos/nesc/pull/11/files#diff-49 [52] https://github.com/tinyos/nesc/pull/11/files#diff-50 [53] https://github.com/tinyos/nesc/pull/11/files#diff-51 [54] https://github.com/tinyos/nesc/pull/11/files#diff-52 [55] https://github.com/tinyos/nesc/pull/11/files#diff-53 [56] https://github.com/tinyos/nesc/pull/11/files#diff-54 [57] https://github.com/tinyos/nesc/pull/11/files#diff-55 [58] https://github.com/tinyos/nesc/pull/11/files#diff-56 [59] https://github.com/tinyos/nesc/pull/11/files#diff-57 [60] https://github.com/tinyos/nesc/pull/11/files#diff-58 [61] https://github.com/tinyos/nesc/pull/11/files#diff-59 [62] https://github.com/tinyos/nesc/pull/11/files#diff-60 [63] https://github.com/tinyos/nesc/pull/11/files#diff-61 [64] https://github.com/tinyos/nesc/pull/11/files#diff-62 [65] https://github.com/tinyos/nesc/pull/11/files#diff-63 [66] https://github.com/tinyos/nesc/pull/11/files#diff-64 [67] https://github.com/tinyos/nesc/pull/11/files#diff-65 [68] https://github.com/tinyos/nesc/pull/11/files#diff-66 [69] https://github.com/tinyos/nesc/pull/11/files#diff-67 [70] https://github.com/tinyos/nesc/pull/11/files#diff-68 [71] https://github.com/tinyos/nesc/pull/11/files#diff-69 [72] https://github.com/tinyos/nesc/pull/11/files#diff-70 [73] https://github.com/tinyos/nesc/pull/11/files#diff-71 [74] https://github.com/tinyos/nesc/pull/11/files#diff-72 [75] https://github.com/tinyos/nesc/pull/11/files#diff-73 [76] https://github.com/tinyos/nesc/pull/11/files#diff-74 [77] https://github.com/tinyos/nesc/pull/11/files#diff-75 [78] https://github.com/tinyos/nesc/pull/11/files#diff-76 [79] https://github.com/tinyos/nesc/pull/11/files#diff-77 [80] https://github.com/tinyos/nesc/pull/11/files#diff-78 [81] https://github.com/tinyos/nesc/pull/11/files#diff-79 [82] https://github.com/tinyos/nesc/pull/11/files#diff-80 [83] https://github.com/tinyos/nesc/pull/11/files#diff-81 [84] https://github.com/tinyos/nesc/pull/11/files#diff-82 [85] https://github.com/tinyos/nesc/pull/11/files#diff-83 [86] https://github.com/tinyos/nesc/pull/11/files#diff-84 [87] https://github.com/tinyos/nesc/pull/11/files#diff-85 [88] https://github.com/tinyos/nesc/pull/11/files#diff-86 [89] https://github.com/tinyos/nesc/pull/11/files#diff-87 [90] https://github.com/tinyos/nesc/pull/11/files#diff-88 [91] https://github.com/tinyos/nesc/pull/11/files#diff-89 [92] https://github.com/tinyos/nesc/pull/11/files#diff-90 [93] https://github.com/tinyos/nesc/pull/11/files#diff-91 [94] https://github.com/tinyos/nesc/pull/11/files#diff-92 [95] https://github.com/tinyos/nesc/pull/11/files#diff-93 [96] https://github.com/tinyos/nesc/pull/11/files#diff-94 [97] https://github.com/tinyos/nesc/pull/11/files#diff-95 [98] https://github.com/tinyos/nesc/pull/11.patch [99] https://github.com/tinyos/nesc/pull/11.diff

— Reply to this email directly or view it on GitHubhttps://github.com/tinyos/nesc/pull/11#issuecomment-17525013 .

Eric B. Decker Senior (over 50 :-) Researcher

ppannuto commented 11 years ago

I don't think the issue is necessarily which convention is chosen, rather that one is chosen. Most of the files have a mixture of tab characters and expanded tabs (spaces), which is very quickly obnoxious if you're editor's tab width doesn't happen to match the original editor's. Worse, there are some files that seem to use any of 2, 4, 8 or I even stumbled across 3 space tabs somewhere.

From what I can tell, TinyOS seems to have converged on 2 space tabs; while I personally tend towards actual tab characters (as they have semantic meaning), it doesn't really matter which convention is selected so long as it's actually consistent. I would strongly support this change, it's a real pet peeve of mine.

cire831 commented 11 years ago

ppannuto wrote:

From what I can tell, TinyOS seems to have converged on 2 space tabs; while I personally tend towards actual tab characters (as they have semantic meaning), it doesn't really matter which convention is selected so long as it's actually consistent. I would strongly support this change, it's a real pet peeve of mine.

It isn't 2 space tabs but a 2 space indent level. If this gets >7 then Emacs starts using actual tab characters.

While I've been tempted to change things when I first started working on TinyOS in a significant way, I currently don't favor changing white space. Too much code over too much time which too many people that will become annoyed one way or the other.

The only real way to make this work is to have a flag day and change all the files at once to something and then encourage everyone to adhere to the tabs/no tabs, indent level.

While I know it can be annoying, is it worth the time to deal with?

dgay42 commented 11 years ago

On 2013-05-06 23:18, Pat Pannuto wrote:

I don't think the issue is necessarily which convention is chosen, rather that one is chosen. Most of the files have a mixture of tab characters and expanded tabs (spaces), which is very quickly obnoxious if you're editor's tab width doesn't happen to match the original editor's. Worse, there are some files that seem to use any of 2, 4, 8 or I even stumbled across 3 space tabs somewhere.

The nesC code should be following the gnu/gcc(*) coding conventions (except that I'm not a big fan of the space-after-function-name in declarations, so those have normally been removed), i.e. essentially indent-by-2, braces on separate lines and indented. There's some exceptions (nesc-doc.c, most obviously), but that's ~the goal. Tab stops should (see below) have nothing to do with indentation.

From what I can tell, TinyOS seems to have converged on 2 space tabs; while I personally tend towards actual tab characters (as they have semantic meaning), it doesn't really matter which convention is selected so long as it's actually consistent. I would strongly support this change, it's a real pet peeve of mine.

It's a pet peeve of most emacs users that many people (and some text editors) confuse whitespace encoding with coding conventions ;)

David Gay *: the C frontend over which nesC is built was derived from gcc 2.8, some pieces have been borrowed from later gcc versions (e.g. src/init.c).

Reply to this email directly or view it on GitHub [1].

Links:

[1] https://github.com/tinyos/nesc/pull/11#issuecomment-17525228

bradjc commented 11 years ago

Too much code over too much time which too many people that will become annoyed one way or the other.

I didn't create this pull request by hand; it only took a 10 line python script. Also, all spaces seems reasonable because every text editor displays that correctly.

Tab stops should (see below) have nothing to do with indentation

Yes, and in theory communism works. But the reality of the world is that for a large number of editors tabs are not strictly an 8-space notion. The world has not converged on the one true editor and using a simple scheme of spaces aids the interest of promoting development and contributions from a wider base of users.

It's a pet peeve of most emacs users that many people (and some text editors) confuse whitespace encoding with coding conventions

[Pat]: Again, such a notion would be fine if these files were all spaces or all tabs, when they are mixed however this fails. In particular, the status quo assumes that all tabs are exactly 8 spaces. Once that is decided, what is the point of using the tab character in the file at all-- to save 7 bytes? The point of tabs is that they provide semantic meaning: an indentation level. Everyone can set their editor to their own preferred whitespace encoding (display tabs as N-spaces), where the current system requires that N == 8 (usually).

cire831 commented 11 years ago

seems like everyone is okay if we convert all whitespace to all spaces and get rid of tabs.

I'm convinced especially after reading TabsAreEvil on the EmacsWiki.

Brad, did you catch all the files. Could I get the python script?

thanks.

bradjc commented 11 years ago
import os
import string

count = 0

for root, dirs, files in os.walk("."):
    for filename in files:
        extension = os.path.splitext(filename)[1]

        if extension == ".c" or extension == ".h":
            f = open(root + "/" + filename, 'r')
            text = f.read()
            text = string.replace(text, '\t', " "*8)
            f.close()

            f = open(root + "/" + filename, 'w')
            f.write(text)
            f.close()

            count += 1

print "changed {} files".format(count)
dgay42 commented 11 years ago

Ok, ok, I concede defeat in the tab wars ;)

cire831 commented 6 years ago

not worth it at this point.

sigh.