Skip to content

Commit

Permalink
Format Lua (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
JakobMiksch authored Nov 2, 2024
1 parent 56dae8d commit 8debdf8
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 21 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: code-style

on:
pull_request:
push:
branches: [main]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/[email protected]

luacheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y lua-check
- name: Check Lua Files
run: luacheck import-theme/
14 changes: 0 additions & 14 deletions .github/workflows/pre-commit.yml

This file was deleted.

2 changes: 0 additions & 2 deletions import-theme/osm-feature-info/init.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
local themepark = ...
local theme = {}


function theme.has_area_tags(tags)
if tags.area == 'yes' then
return true
Expand Down
10 changes: 5 additions & 5 deletions import-theme/osm-feature-info/topics/geography_tables.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local themepark, theme, cfg = ...
local themepark, theme = ...

themepark:set_option('srid', 4326)

Expand All @@ -24,7 +24,7 @@ themepark:add_table{
tiles = false
}

themepark:add_proc('node', function(object, data)
themepark:add_proc('node', function(object)
themepark:insert('geom_nodes', {
geog = object:as_point()
}, object.tags)
Expand All @@ -51,9 +51,9 @@ themepark:add_table{
tiles = false
}

themepark:add_proc('way', function(object, data)
themepark:add_proc('way', function(object)

attributes = {}
local attributes
if object.is_closed and theme.has_area_tags(object.tags) then
attributes = {
geog = object:as_polygon()
Expand Down Expand Up @@ -87,7 +87,7 @@ themepark:add_table{
}},
tiles = false
}
themepark:add_proc('relation', function(object, data)
themepark:add_proc('relation', function(object)
local relation_type = object:grab_tag('type')
local geog

Expand Down

0 comments on commit 8debdf8

Please sign in to comment.