[TASK] Add editorconfig & format code (#94)

This commit is contained in:
Xaver Maierhofer 2017-11-06 00:59:42 +01:00 committed by Julian K
parent 918b279b23
commit 93321ab3ad
8 changed files with 184 additions and 130 deletions

17
.editorconfig Normal file
View File

@ -0,0 +1,17 @@
; http://editorconfig.org/
root = true
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
trim_trailing_whitespace = true
[*.go]
indent_style = tab
indent_size = 4
[*.{json,yml}]
indent_style = space
indent_size = 2

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import json
import argparse import argparse
import json
import sys import sys
@ -18,6 +18,7 @@ def main(states, nodeid):
with open(states, 'w') as handle: with open(states, 'w') as handle:
json.dump(data, handle) json.dump(data, handle)
if __name__ == '__main__': if __name__ == '__main__':
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
@ -29,4 +30,3 @@ if __name__ == '__main__':
args = parser.parse_args() args = parser.parse_args()
main(args.states, args.nodeid) main(args.states, args.nodeid)

View File

@ -8,7 +8,6 @@ import (
var multiCastGroup = net.ParseIP("ff02:0:0:0:0:0:2:1001") var multiCastGroup = net.ParseIP("ff02:0:0:0:0:0:2:1001")
const ( const (
// default udp port used by announced // default udp port used by announced
port = 1001 port = 1001

View File

@ -6,8 +6,12 @@
"mesh": { "mesh": {
"bat0": { "bat0": {
"interfaces": { "interfaces": {
"wireless":["a"], "wireless": [
"other":["a2"] "a"
],
"other": [
"a2"
]
} }
} }
} }
@ -17,13 +21,21 @@
"batadv": { "batadv": {
"a": { "a": {
"neighbours": { "neighbours": {
"b":{"tq":150,"lastseen":0.42}, "b": {
"c":{"tq":250,"lastseen":0.42} "tq": 150,
"lastseen": 0.42
},
"c": {
"tq": 250,
"lastseen": 0.42
}
} }
} }
}, },
"lldp": { "lldp": {
"a2": {"c2": {}} "a2": {
"c2": {}
}
} }
} }

View File

@ -5,7 +5,9 @@
"mesh": { "mesh": {
"bat0": { "bat0": {
"interfaces": { "interfaces": {
"wireless":["b"] "wireless": [
"b"
]
} }
} }
} }
@ -15,7 +17,10 @@
"batadv": { "batadv": {
"b": { "b": {
"neighbours": { "neighbours": {
"a":{"tq":250,"lastseen":0.42} "a": {
"tq": 250,
"lastseen": 0.42
}
} }
} }
} }

View File

@ -5,8 +5,12 @@
"mesh": { "mesh": {
"bat0": { "bat0": {
"interfaces": { "interfaces": {
"wireless":["c"], "wireless": [
"other":["c2"] "c"
],
"other": [
"c2"
]
} }
} }
} }
@ -16,12 +20,17 @@
"batadv": { "batadv": {
"c": { "c": {
"neighbours": { "neighbours": {
"a":{"tq":200,"lastseen":0.42} "a": {
"tq": 200,
"lastseen": 0.42
}
} }
} }
}, },
"lldp": { "lldp": {
"c2": {"a2": {}} "c2": {
"a2": {}
}
} }
} }

View File

@ -5,8 +5,13 @@
"mesh": { "mesh": {
"bat0": { "bat0": {
"interfaces": { "interfaces": {
"wireless":["unneed","unneed2"], "wireless": [
"tunnel":["d"] "unneed",
"unneed2"
],
"tunnel": [
"d"
]
} }
} }
} }
@ -16,7 +21,10 @@
"batadv": { "batadv": {
"d": { "d": {
"neighbours": { "neighbours": {
"a":{"tq":200,"lastseen":0.42} "a": {
"tq": 200,
"lastseen": 0.42
}
} }
} }
} }

View File

@ -8,7 +8,9 @@
"mesh": { "mesh": {
"bat0": { "bat0": {
"interfaces": { "interfaces": {
"wireless":["a"] "wireless": [
"a"
]
} }
} }
} }
@ -23,7 +25,9 @@
"mesh": { "mesh": {
"bat0": { "bat0": {
"interfaces": { "interfaces": {
"wireless":["a"] "wireless": [
"a"
]
} }
} }
} }