Skip to content
Permalink
Browse files

Add editorconfig linting to Travis (#360)

* Add Luacheck exclusions for TRP3_* globals

* Add Luacheck global generation script

Updates the contents of the WoW-provided globals with data
extracted from the game by a third party. This covers 99% of the
API it seems, and matches our existing approach with the giant
luacheck file.

Manual additions were made to cover any other missing global
defines that we hadn't yet sorted out.

* Fix undefined global accesses in MI reordering

* Kill RP.IO leftovers

* Fix mixed indentation

* Normalize editorconfig in all files

* Fix tooling installation for Travis

Because nothing's ever bloody simple with Travis.

* Remove install-latest-npm

Shouldn't be needed if the command output from the previous
install command is indeed accurate.

* Remove old comment from editorconfig

* Undo an overeager indentation fix in changelog
  • Loading branch information...
Meorawr authored and Solanya committed Sep 22, 2019
1 parent 31ad26d commit 4040d59a92a85a7ff61bca79119fdfc2aa21cc4c
Showing with 306 additions and 346 deletions.
  1. +6 −1 .editorconfig
  2. BIN .gitattributes
  3. +9 −7 .travis.yml
  4. +2 −1 Scripts/generate_mature_dict.sh
  5. +0 −42 Scripts/list_icons.sh
  6. +1 −1 Scripts/mature_dictionary_template.lua
  7. +2 −1 Scripts/release.sh
  8. +9 −9 totalRP3/Bindings.xml
  9. +0 −2 totalRP3/core/impl/CommunicationProtocol.lua
  10. +30 −30 totalRP3/core/impl/profiles.lua
  11. +2 −2 totalRP3/core/impl/utils.lua
  12. +11 −11 totalRP3/core/ui/browsers/colors.xml
  13. +5 −5 totalRP3/core/ui/browsers/companions.xml
  14. +11 −11 totalRP3/core/ui/browsers/icons.xml
  15. +7 −7 totalRP3/core/ui/browsers/images.xml
  16. +8 −8 totalRP3/core/ui/browsers/musics.xml
  17. +5 −5 totalRP3/core/ui/configuration.xml
  18. +9 −9 totalRP3/core/ui/main.xml
  19. +2 −2 totalRP3/core/ui/profiles.xml
  20. +5 −6 totalRP3/core/ui/widgets.xml
  21. +12 −12 totalRP3/modules/ChatLinks/ChatLinks.xml
  22. +1 −1 totalRP3/modules/Languages/Languages.xml
  23. +1 −1 totalRP3/modules/chatframe/chatframe.xml
  24. +2 −2 totalRP3/modules/dashboard/HTMLContent.xml
  25. +2 −2 totalRP3/modules/dashboard/TabFrame.xml
  26. +3 −3 totalRP3/modules/importer/importer.xml
  27. +2 −2 totalRP3/modules/map/WorldMapButton.lua
  28. +17 −17 totalRP3/modules/modules.xml
  29. +22 −22 totalRP3/modules/register/characters/register_ui_about.xml
  30. +19 −19 totalRP3/modules/register/characters/register_ui_characteristics.xml
  31. +6 −6 totalRP3/modules/register/characters/register_ui_main.xml
  32. +1 −1 totalRP3/modules/register/characters/register_ui_misc.xml
  33. +3 −3 totalRP3/modules/register/characters/register_ui_notes.xml
  34. +2 −2 totalRP3/modules/register/companions/register_ui_companions_main.xml
  35. +39 −39 totalRP3/modules/register/companions/register_ui_companions_page.xml
  36. +5 −5 totalRP3/modules/register/companions/register_ui_companions_profiles.xml
  37. +5 −9 totalRP3/modules/register/filter/register_mature_filter.xml
  38. +1 −1 totalRP3/modules/register/filter/register_mature_filter_dictionary.lua
  39. +10 −10 totalRP3/modules/register/main/register_tooltip.lua
  40. +1 −1 totalRP3/modules/register/main/register_ui_glance.xml
  41. +4 −4 totalRP3/modules/targetframe/target_frame.xml
  42. +3 −3 totalRP3/modules/toolbar/toolbar.xml
  43. +1 −1 totalRP3/modules/tooltip_skins/tooltips_skins.xml
  44. +1 −1 totalRP3/resources/iconList.lua
  45. +1 −1 totalRP3/resources/musicList.lua
  46. +3 −3 totalRP3/resources/resources.xml
  47. +1 −1 totalRP3/tools/HTML.xml
  48. +14 −14 totalRP3/tools/tools.xml
@@ -4,13 +4,14 @@
root = true

# For the sake of consistency across the entire project we want:
# - Carriage Return Line Feed (we started with that because Windows ¯\_(ツ)_/¯ )
# - UTF-8 encoding
# - TABS!
[*]
end_of_line = unset
charset = utf-8
indent_style = tab
trim_trailing_whitespace = true
insert_final_newline = true

[*.sh]
end_of_line = lf
@@ -19,3 +20,7 @@ end_of_line = lf
[.pkgmeta]
indent_style = space
indent_size = 2

[*.yml]
indent_style = space
indent_size = 2
BIN -30 Bytes (44%) .gitattributes
Binary file not shown.
@@ -1,20 +1,22 @@
# Travis CI configuration file
# http://travis-ci.org

sudo: false
dist: bionic
language: minimal

addons:
apt:
packages:
- luarocks
- luarocks

git:
depth: 150
install:
- luarocks install --local luacheck
- nvm install node
- npm install -g eclint

install: luarocks install --local luacheck

script: /home/travis/.luarocks/bin/luacheck .
script:
- /home/travis/.luarocks/bin/luacheck .
- eclint check $(git ls-files '*.lua' '*.sh' '*.xml' ':!:totalRP3/libs/**/*' ':!:totalRP3/tools/Locale.lua')

deploy:
provider: script
@@ -1,2 +1,3 @@
#!/bin/sh
cd ./mature-dict/
./converToLua.sh ../../../totalRP3/modules/register/filter/register_mature_filter_dictionary.lua ../mature_dictionary_template.lua
./converToLua.sh ../../../totalRP3/modules/register/filter/register_mature_filter_dictionary.lua ../mature_dictionary_template.lua

This file was deleted.

@@ -9,4 +9,4 @@ function TRP3_API.utils.resources.getMatureFilterDictionary()
end

return dictionary[currentLocale]
end
end
@@ -1,2 +1,3 @@
#!/bin/sh
curl -s https://raw.githubusercontent.com/Total-RP/packager/master/release.sh | bash -s -- -p 75973 -w 24113 -g 8.2.0 -o
curl -s https://raw.githubusercontent.com/Total-RP/packager/master/release.sh | bash -s -- -p 335857 -w 25153 -g 1.13.2 -o
curl -s https://raw.githubusercontent.com/Total-RP/packager/master/release.sh | bash -s -- -p 335857 -w 25153 -g 1.13.2 -o
@@ -16,12 +16,12 @@
-->

<Bindings>
<Binding name="TRP3_TOGGLE" header="TRP3">
TRP3_API.navigation.switchMainFrame();
</Binding>
<Binding name="TRP3_TOOLBAR_TOGGLE">
if TRP3_API.toolbar then
TRP3_API.toolbar.switch();
end
</Binding>
</Bindings>
<Binding name="TRP3_TOGGLE" header="TRP3">
TRP3_API.navigation.switchMainFrame();
</Binding>
<Binding name="TRP3_TOOLBAR_TOGGLE">
if TRP3_API.toolbar then
TRP3_API.toolbar.switch();
end
</Binding>
</Bindings>
@@ -345,5 +345,3 @@ TRP3_API.communication.addMessageIDHandler = function(sender, reservedMessageID,
end

Ellyb.DeprecationWarnings.wrapAPI(AddOn_TotalRP3.Communications, "TRP3_API.communication", "AddOn_TotalRP3.Communications", TRP3_API.communication);


@@ -532,41 +532,41 @@ function TRP3_API.profile.init()
end
end);

-- Stash data command
-- Will move all the user data in a stash variable and reload UI with empty variables,
-- and then restore the data on the second use.
-- Used for debugging/testing
TRP3_API.slash.registerCommand({
id = "stash",
handler = function()
-- The list of our global variables that will be stashed away.
local globalVariables = {"TRP3_Profiles", "TRP3_Characters", "TRP3_Configuration", "TRP3_Flyway", "TRP3_Presets", "TRP3_Companions", "TRP3_Colors"};
-- If we already have data stashed, restore the data
if TRP3_StashedData then
for _, variable in pairs(globalVariables) do
-- Stash data command
-- Will move all the user data in a stash variable and reload UI with empty variables,
-- and then restore the data on the second use.
-- Used for debugging/testing
TRP3_API.slash.registerCommand({
id = "stash",
handler = function()
-- The list of our global variables that will be stashed away.
local globalVariables = {"TRP3_Profiles", "TRP3_Characters", "TRP3_Configuration", "TRP3_Flyway", "TRP3_Presets", "TRP3_Companions", "TRP3_Colors"};
-- If we already have data stashed, restore the data
if TRP3_StashedData then
for _, variable in pairs(globalVariables) do
-- Copy stashed data into the global variable
tcopy(_G[variable], TRP3_StashedData[variable] or _G[variable]);
end
-- Empty the stash so we know we can use it again
TRP3_StashedData = nil;
tcopy(_G[variable], TRP3_StashedData[variable] or _G[variable]);
end
-- Empty the stash so we know we can use it again
TRP3_StashedData = nil;
ReloadUI();
else
-- Ask for confirmation before stashing user data!
showConfirmPopup(loc.COM_STASH_DATA, function()
TRP3_StashedData = {};
-- Loop through each global variable we want to stash
for _, variable in pairs(globalVariables) do
else
-- Ask for confirmation before stashing user data!
showConfirmPopup(loc.COM_STASH_DATA, function()
TRP3_StashedData = {};
-- Loop through each global variable we want to stash
for _, variable in pairs(globalVariables) do
TRP3_StashedData[variable] = {}
-- Store the globale variable data into the stash
tcopy(TRP3_StashedData[variable], _G[variable]);
-- And empty the variable
_G[variable] = nil;
end
tcopy(TRP3_StashedData[variable], _G[variable]);
-- And empty the variable
_G[variable] = nil;
end
ReloadUI();
end);
end
end
});
end);
end
end
});

-- Export/Import
local exportWarningText = TRP3_API.Ellyb.System.IsMac() and loc.PR_EXPORT_WARNING_MAC or loc.PR_EXPORT_WARNING_WINDOWS;
@@ -466,7 +466,7 @@ For players: Player-[server ID]-[player UID] (Example: "Player-976-0002FD64")
For creatures, pets, objects, and vehicles: [Unit type]-0-[server ID]-[instance ID]-[zone UID]-[ID]-[Spawn UID] (Example: "Creature-0-976-0-11-31146-000136DF91")
Unit Type Names: "Creature", "Pet", "GameObject", and "Vehicle"
For vignettes: Vignette-0-[server ID]-[instance ID]-[zone UID]-0-[spawn UID] (Example: "Vignette-0-970-1116-7-0-0017CAE465" for rare mob Sulfurious)
]]
]]
Utils.guid = {};

local GUID_TYPES = {
@@ -557,7 +557,7 @@ end
-- @return True if the text will be readable
--
local textColorIsReadableOnBackground = function(textColor)
return ((0.299 * textColor.r + 0.587 * textColor.g + 0.114 * textColor.b)) >= 0.5;
return ((0.299 * textColor.r + 0.587 * textColor.g + 0.114 * textColor.b)) >= 0.5;
end

Utils.color.textColorIsReadableOnBackground = textColorIsReadableOnBackground;
@@ -1,5 +1,5 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.blizzard.com/wow/ui/">

<!--
@@ -20,7 +20,7 @@
-->

<!-- Color browser -->
<Frame name="TRP3_ColorBrowser" parent="TRP3_PopupsFrame" hidden="true">
<Frame name="TRP3_ColorBrowser" parent="TRP3_PopupsFrame" hidden="true">
<Backdrop bgFile="Interface\AchievementFrame\UI-Achievement-StatsBackground" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
<EdgeSize><AbsValue val="24"/></EdgeSize><TileSize><AbsValue val="415"/></TileSize>
<BackgroundInsets><AbsInset left="5" right="5" top="5" bottom="5"/></BackgroundInsets>
@@ -40,7 +40,7 @@
<Color b="0.95" r="0.95" g="0.95"/>
</FontString>
</Layer>

</Layers>
<Frames>
<Button inherits="UIPanelCloseButton">
@@ -66,7 +66,7 @@
<Anchor point="BOTTOMRIGHT" x="-10" y="10"/>
</Anchors>
<Frames>

<ColorSelect name="TRP3_ColorBrowserColor" enableMouse="true" enableKeyboard="true">
<Size x="365" y="128"/>
<Anchors>
@@ -99,25 +99,25 @@
<Anchors>
<Anchor x="-86" y="13"/>
</Anchors>
<TexCoords left="0" right="1" top="0.11" bottom="1" />
<TexCoords left="0" right="1" top="0.11" bottom="1" />
</Texture>
<Texture file="Interface\BUTTONS/UI-Quickslot2">
<Size x="60" y="60"/>
<Anchors>
<Anchor x="280" y="-35"/>
</Anchors>
</Anchors>
</Texture>
</Layer>
</Layers>
</ColorSelect>

<Button name="TRP3_ColorBrowserSelect" inherits="TRP3_CommonButton" text="[SELECT]">
<Size x="145" y="20"/>
<Anchors>
<Anchors>
<Anchor point="BOTTOM" x="0" y="15"/>
</Anchors>
</Button>

<EditBox name="TRP3_ColorBrowserEditBox" inherits="TRP3_TitledHelpEditBox" letters="7">
<Anchors>
<Anchor point="RIGHT" relativePoint="LEFT" relativeTo="TRP3_ColorBrowserSelect" x="-15" y="0"/>
@@ -130,7 +130,7 @@
<Anchor point="TOPRIGHT" relativeTo="TRP3_ColorBrowserColor" relativePoint="BOTTOMRIGHT" />
</Anchors>
</Button>

</Frames>
<Layers>
<Layer level="ARTWORK">
@@ -146,5 +146,5 @@
</Frame>
</Frames>
</Frame>
</Ui>

</Ui>
@@ -1,7 +1,7 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.blizzard.com/wow/ui/">

<!--
Total RP 3
Copyright 2014 Sylvain Cossement (telkostrasz@telkostrasz.be)
@@ -20,7 +20,7 @@
-->

<!-- Icon browser -->
<Frame name="TRP3_CompanionBrowser" parent="TRP3_PopupsFrame" hidden="true">
<Frame name="TRP3_CompanionBrowser" parent="TRP3_PopupsFrame" hidden="true">
<Backdrop bgFile="Interface\AchievementFrame\UI-Achievement-StatsBackground" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
<EdgeSize>
<AbsValue val="16"/>
@@ -142,5 +142,5 @@
</Layer>
</Layers>
</Frame>
</Ui>

</Ui>

0 comments on commit 4040d59

Please sign in to comment.
You can’t perform that action at this time.