Skip to content

Commit

Permalink
Add luacheck, repo cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Niklp09 authored and SmallJoker committed Sep 3, 2023
1 parent 78e74b0 commit 0f67c9e
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 183 deletions.
17 changes: 1 addition & 16 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,17 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto

# Custom for Visual Studio
*.cs diff=csharp

# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
* text=auto
10 changes: 10 additions & 0 deletions .github/workflows/luacheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: luacheck
on: [push, pull_request]
jobs:
luacheck:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Luacheck
uses: lunarmodules/luacheck@master
47 changes: 0 additions & 47 deletions .gitignore

This file was deleted.

8 changes: 8 additions & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
read_globals = {
"minetest",
"default"
}

globals = {
"castle_shields"
}
23 changes: 6 additions & 17 deletions default_shields.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,14 @@ minetest.register_alias("castle:shield", "castle_shields:shield_1")
minetest.register_alias("castle:shield_2", "castle_shields:shield_2")
minetest.register_alias("castle:shield_3", "castle_shields:shield_3")

-- Translation support
local S = minetest.get_translator("castle_shields")

-- Used for localization, choose either built-in or intllib.
-- The following colors are permitted:
-- "black", "blue", "brown", "cyan", "dark_green", "dark_grey", "green", "grey",
-- "magenta", "orange", "pink", "red", "violet", "white", "yellow"

local MP, S, NS = nil

if (minetest.get_modpath("intllib") == nil) then
S = minetest.get_translator("castle_shields")

else
-- internationalization boilerplate
MP = minetest.get_modpath(minetest.get_current_modname())
S, NS = dofile(MP.."/intllib.lua")

end


--The following colors are permitted:
-- "black", "blue", "brown", "cyan", "dark_green", "dark_grey", "green", "grey", "magenta", "orange", "pink", "red", "violet", "white", "yellow"
--The following patterns are permitted:
-- The following patterns are permitted:
-- "slash", "chevron", "cross"

-- method parameters are name, desc, background_color, foreground_color, pattern
Expand Down
3 changes: 0 additions & 3 deletions depends.txt

This file was deleted.

1 change: 0 additions & 1 deletion description.txt

This file was deleted.

45 changes: 0 additions & 45 deletions intllib.lua

This file was deleted.

3 changes: 1 addition & 2 deletions locale/castle_shields.it.tr
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
# textdomain:castle_shields

# textdomain: castle_shields
Mounted Shield=Scudo appeso
23 changes: 0 additions & 23 deletions locale/it.po

This file was deleted.

21 changes: 0 additions & 21 deletions locale/template.pot

This file was deleted.

3 changes: 1 addition & 2 deletions locale/template.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
# textdomain:castle_shields

# textdomain: castle_shields
Mounted Shield=
3 changes: 1 addition & 2 deletions mod.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
name = castle_shields
description = Adds decorative wall shields
depends = default, dye
optional_depends = intllib
depends = default, dye
9 changes: 5 additions & 4 deletions shield_functions.lua
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
castle_shields.register_shield = function(name, desc, background_color, foreground_color, mask, disable_recipe)

local tile_side = "castle_shield_"..background_color..".png"
local tile_front = "castle_shield_"..background_color..".png^(castle_shield_"..foreground_color..".png^[mask:castle_shield_mask_"..mask..".png)"
local tile_front = "castle_shield_"..background_color..".png^(castle_shield_"..foreground_color..
".png^[mask:castle_shield_mask_"..mask..".png)"

minetest.register_node(minetest.get_current_modname()..":"..name, {
description = desc,
tiles = {tile_side, tile_side, tile_side, tile_side, "castle_shield_back.png", tile_front},
drawtype="nodebox",
drawtype = "nodebox",
paramtype2 = "facedir",
paramtype = "light",
groups={cracky=3},
groups = {cracky=3},
sounds = default.node_sound_metal_defaults(),
node_box = {
type = "fixed",
Expand All @@ -27,7 +28,7 @@ castle_shields.register_shield = function(name, desc, background_color, foregrou
},
},
})

if disable_recipe then
-- recipe disabled by caller
return
Expand Down

0 comments on commit 0f67c9e

Please sign in to comment.