Skip to content

Commit 48b8ddf

Browse files
authored
Merge pull request freifunk-gluon#159 from T-X/pr-sync-editorconfig-checker
treewide: SPDX header migration and spacing fixes
2 parents a64fb18 + 519e6eb commit 48b8ddf

File tree

63 files changed

+1218
-1230
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1218
-1230
lines changed

.editorconfig

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,33 @@ insert_final_newline = true
77
indent_style = tab
88
charset = utf-8
99

10+
[*.dia]
11+
indent_style = space
12+
indent_size = 2
13+
14+
[*{.json,.ecrc}]
15+
indent_style = space
16+
indent_size = 2
17+
18+
[{Makefile,*.mk}]
19+
indent_style = unset
20+
21+
[*.md]
22+
indent_style = space
23+
indent_size = 4
24+
1025
[*.py]
1126
indent_style = space
1227
indent_size = 4
1328

29+
[*.rst]
30+
indent_style = space
31+
indent_size = 2
32+
33+
[*.yml]
34+
indent_style = space
35+
indent_size = 2
36+
37+
[CMakeLists.txt]
38+
indent_style = space
39+
indent_size = 2

.editorconfig-checker.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"SpacesAfterTabs": true,
3+
"Exclude": [
4+
"README.md",
5+
"LICENSE"
6+
]
7+
}

.github/workflows/lint.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,10 @@ jobs:
3030
fail_level: any
3131
check_all_files_with_shebangs: true
3232
filter_mode: nofilter
33+
34+
editorconfig:
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v4
38+
- uses: editorconfig-checker/action-editorconfig-checker@main
39+
- run: editorconfig-checker

ff-ap-timer/luasrc/usr/sbin/ap-timer

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3,56 +3,56 @@ local timestamp = os.time()
33
local uci = require('simple-uci').cursor()
44

55
local function compare(list, value)
6-
if not list then
7-
return nil
8-
end
6+
if not list then
7+
return nil
8+
end
99

10-
for _, v in ipairs(list) do
11-
if v == value then
12-
return true
13-
end
14-
end
10+
for _, v in ipairs(list) do
11+
if v == value then
12+
return true
13+
end
14+
end
1515

16-
return false
16+
return false
1717
end
1818

1919
local function getDay()
20-
local type = uci:get('ap-timer', 'settings', 'type')
21-
if type == 'day' then return 'all'
22-
elseif type == 'week' then return os.date('%a', timestamp)
23-
elseif type == 'month' then return os.date('%d', timestamp)
24-
else return nil
25-
end
20+
local type = uci:get('ap-timer', 'settings', 'type')
21+
if type == 'day' then return 'all'
22+
elseif type == 'week' then return os.date('%a', timestamp)
23+
elseif type == 'month' then return os.date('%d', timestamp)
24+
else return nil
25+
end
2626
end
2727

2828
local function apSet(enable)
29-
local execWifi = false
30-
local radios = {'client_radio0', 'client_radio1'}
31-
for _, radio in ipairs(radios) do
32-
if uci:get('wireless', radio) then
33-
uci:set('wireless', radio, 'disabled', not enable)
34-
execWifi = true
35-
end
36-
end
37-
38-
if execWifi then
39-
uci:save('wireless')
40-
os.execute('wifi')
41-
end
29+
local execWifi = false
30+
local radios = {'client_radio0', 'client_radio1'}
31+
for _, radio in ipairs(radios) do
32+
if uci:get('wireless', radio) then
33+
uci:set('wireless', radio, 'disabled', not enable)
34+
execWifi = true
35+
end
36+
end
37+
38+
if execWifi then
39+
uci:save('wireless')
40+
os.execute('wifi')
41+
end
4242
end
4343

4444
if uci:get_bool('ap-timer', 'settings', 'enabled') then
45-
local day = getDay()
46-
local current = os.date('%H:%M', timestamp)
45+
local day = getDay()
46+
local current = os.date('%H:%M', timestamp)
4747

48-
local off = compare(uci:get_list('ap-timer', day, 'off'), current)
49-
local on = compare(uci:get_list('ap-timer', day, 'on'), current)
48+
local off = compare(uci:get_list('ap-timer', day, 'off'), current)
49+
local on = compare(uci:get_list('ap-timer', day, 'on'), current)
5050

51-
if on and not off then
52-
apSet(true)
53-
end
51+
if on and not off then
52+
apSet(true)
53+
end
5454

55-
if off and not on then
56-
apSet(false)
57-
end
55+
if off and not on then
56+
apSet(false)
57+
end
5858
end

ffac-autoupdater-wifi-fallback/luasrc/lib/gluon/upgrade/510-autoupdater-wifi-fallback

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,29 @@ local uci = require('simple-uci').cursor()
44

55
local enabled
66
if uci:get('autoupdater-wifi-fallback', 'settings') then
7-
enabled = uci:get_bool('autoupdater-wifi-fallback', 'settings', 'enabled')
8-
uci:delete('autoupdater-wifi-fallback', 'settings')
7+
enabled = uci:get_bool('autoupdater-wifi-fallback', 'settings', 'enabled')
8+
uci:delete('autoupdater-wifi-fallback', 'settings')
99
else
10-
enabled = uci:get_bool('autoupdater', 'settings', 'enabled')
10+
enabled = uci:get_bool('autoupdater', 'settings', 'enabled')
1111
end
1212

1313
uci:section('autoupdater-wifi-fallback', 'autoupdater-wifi-fallback', 'settings',{
14-
enabled = enabled,
14+
enabled = enabled,
1515
})
1616

1717
uci:delete('network', 'fallback')
1818
uci:delete('network', 'fallback6')
1919

2020
uci:section('network', 'interface', 'fallback',{
21-
proto = 'dhcp',
22-
peerdns = true,
23-
sourcefilter = false,
21+
proto = 'dhcp',
22+
peerdns = true,
23+
sourcefilter = false,
2424
})
2525
uci:section('network', 'interface', 'fallback6',{
26-
ifname = '@fallback',
27-
proto = 'dhcpv6',
28-
peerdns = true,
29-
sourcefilter = false,
26+
ifname = '@fallback',
27+
proto = 'dhcpv6',
28+
peerdns = true,
29+
sourcefilter = false,
3030
})
3131

3232
uci:save('autoupdater-wifi-fallback')

ffac-autoupdater-wifi-fallback/luasrc/usr/lib/lua/autoupdater-wifi-fallback/util.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ function M.get_update_hosts(branch)
5555
return hosts
5656
end
5757

58-
return M
58+
return M

0 commit comments

Comments
 (0)