Skip to content

Commit 81e55e5

Browse files
committed
remove luacheck lint warnings
1 parent 86bfaa3 commit 81e55e5

File tree

2 files changed

+29
-27
lines changed

2 files changed

+29
-27
lines changed

samples/text_editor_control.lua

+24-24
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ print(edit_text:GetControlID())
4141
local tabstop_width = calc_tab_width(edit_font, 4)
4242
edit_text:SetTabstopWidth(tabstop_width)
4343
edit_text:SetAutomaticEditing(true)
44-
dlg:RegisterHandleControlEvent(edit_text, function(control)
44+
dlg:RegisterHandleControlEvent(edit_text, function(control) -- luacheck: ignore
4545
-- local finale.FCString = control:CreateEnigmaString()
4646
-- print("Got Enigma String: "..finale.FCString.LuaString)
4747
end)
@@ -53,7 +53,7 @@ local non_bmp_text = [[𝒜𝓈 𝒸𝒽
5353
𝓊𝓃𝓈𝑒
5454
𝓉𝓈 𝒾𝓃 𝓉𝒽𝑒 𝓋𝒶𝓈𝓉 𝒾𝓃𝓉𝓸 𝓉𝒽𝑒 𝓊𝓃𝓀𝓃𝑜𝓌𝓃
5555
𝒾𝓈 𝒶 𝒷𝑒𝒶𝓊𝓉𝒾𝒻𝓊𝓁 𝓂𝒶𝑔𝒾𝒸 𝑜𝒻 𝒸𝒽𝒶𝓇𝒶𝒸𝓉𝑒𝓇𝓈.]]
56-
local long_line_text = "This is a test. Now is the time for a very long string to come to the aid and comfort of their friends and enemies to create a very, very long string."
56+
local long_line_text = "This is a test. Now is the time for a very long string to come to the aid and comfort of their friends and enemies to create a very, very long string." -- luacheck: ignore
5757
local rtf_text = [[{\rtf1\ansi
5858
This is some {\b bold} text.
5959
This is some {\i italic} text.
@@ -80,40 +80,41 @@ dlg:RegisterHandleControlEvent(enabler, function(control)
8080
end)
8181
local visifier = dlg:CreateButton(90, 200)
8282
visifier:SetText(finale.FCString("Visible"))
83-
dlg:RegisterHandleControlEvent(visifier, function(control)
83+
dlg:RegisterHandleControlEvent(visifier, function(control) -- luacheck: ignore
8484
edit_text:SetVisible(not edit_text:GetVisible())
8585
enabler:SetVisible(not enabler:GetVisible())
8686
edit_text:SetKeyboardFocus()
8787
end)
8888
local readonly = dlg:CreateButton(170, 200)
8989
readonly:SetText(finale.FCString("Readonly"))
90-
dlg:RegisterHandleControlEvent(readonly, function(control)
90+
dlg:RegisterHandleControlEvent(readonly, function(control) -- luacheck: ignore
9191
edit_text:SetReadOnly(not edit_text:GetReadOnly())
9292
edit_text:SetKeyboardFocus()
9393
end)
9494
local sizer = dlg:CreateButton(250, 200)
9595
sizer:SetText(finale.FCString("Size"))
96-
dlg:RegisterHandleControlEvent(sizer, function(control)
97-
if not glob_size then glob_size = 10 end
98-
glob_size = glob_size * 1.25
99-
edit_text:SetFontSizeForSelection(glob_size)
96+
local size_incrementer
97+
dlg:RegisterHandleControlEvent(sizer, function(control) -- luacheck: ignore
98+
if not size_incrementer then size_incrementer = 10 end
99+
size_incrementer = size_incrementer * 1.25
100+
edit_text:SetFontSizeForSelection(size_incrementer)
100101
end)
101102
local copier = dlg:CreateButton(330, 200)
102103
copier:SetText(finale.FCString("Copy"))
103-
dlg:RegisterHandleControlEvent(copier, function(control)
104+
dlg:RegisterHandleControlEvent(copier, function(control) -- luacheck: ignore
104105
edit_text:TextToClipboard()
105106
end)
106107
local replacer = dlg:CreateButton(10, 225)
107108
replacer:SetText(finale.FCString("Replace"))
108-
dlg:RegisterHandleControlEvent(replacer, function(control)
109+
dlg:RegisterHandleControlEvent(replacer, function(control) -- luacheck: ignore
109110
if not edit_text:ReplaceSelectedText(finale.FCString("*** replaced\ntext ***")) then
110111
print("ReplaceSelectedText failed because no selected text.")
111112
end
112113
edit_text:SetKeyboardFocus()
113114
end)
114115
local restorer = dlg:CreateButton(90, 225)
115116
restorer:SetText(finale.FCString("Restore"))
116-
dlg:RegisterHandleControlEvent(restorer, function(control)
117+
dlg:RegisterHandleControlEvent(restorer, function(control) -- luacheck: ignore
117118
-- local vers1 = finale.FCVerseLyricsText()
118119
-- if not vers1:Load(1) then print("lyrics load failed") end
119120
-- local versstr = vers1:CreateString()
@@ -125,21 +126,21 @@ dlg:RegisterHandleControlEvent(restorer, function(control)
125126
end)
126127
local inserter = dlg:CreateButton(170, 225)
127128
inserter:SetText(finale.FCString("Insert"))
128-
dlg:RegisterHandleControlEvent(inserter, function(control)
129+
dlg:RegisterHandleControlEvent(inserter, function(control) -- luacheck: ignore
129130
edit_text:InsertTextAtCursor(finale.FCString("*** inserted text ***"))
130131
edit_text:SetKeyboardFocus()
131132
end)
132133
local selectall = dlg:CreateButton(250, 225)
133134
selectall:SetText(finale.FCString("SelAll"))
134-
dlg:RegisterHandleControlEvent(selectall, function(control)
135+
dlg:RegisterHandleControlEvent(selectall, function(control) -- luacheck: ignore
135136
local range = finale.FCRange()
136137
edit_text:GetTotalTextRange(range)
137138
edit_text:SetSelection(range)
138139
edit_text:SetKeyboardFocus()
139140
end)
140141
local tabber = dlg:CreateButton(10, 250)
141142
tabber:SetText(finale.FCString("Tabs"))
142-
dlg:RegisterHandleControlEvent(tabber, function(control)
143+
dlg:RegisterHandleControlEvent(tabber, function(control) -- luacheck: ignore
143144
tabstop_width = tabstop_width - 12
144145
if tabstop_width < 12 then
145146
tabstop_width = 12
@@ -171,7 +172,7 @@ dlg:RegisterHandleControlEvent(italicer, function(control)
171172
local locinfo = dlg:CreateButton(330, 250)
172173
locinfo:SetText(finale.FCString("Loc."))
173174
locinfo:SetWidth(70)
174-
dlg:RegisterHandleControlEvent(locinfo, function(control)
175+
dlg:RegisterHandleControlEvent(locinfo, function(control) -- luacheck: ignore
175176
local selrange = finale.FCRange()
176177
edit_text:GetSelection(selrange)
177178
local posrange = finale.FCRange()
@@ -195,7 +196,7 @@ wordonly:SetWidth(70)
195196
local igncase = dlg:CreateCheckbox(250, 275)
196197
igncase:SetText(finale.FCString("Ign Case"))
197198
igncase:SetWidth(70)
198-
dlg:RegisterHandleControlEvent(finder, function(control)
199+
dlg:RegisterHandleControlEvent(finder, function(control) -- luacheck: ignore
199200
local str = finale.FCString()
200201
findtext:GetText(str)
201202
local options = 0
@@ -223,7 +224,7 @@ dlg:RegisterHandleControlEvent(finder, function(control)
223224
local dumper = dlg:CreateButton(330, 275)
224225
dumper:SetText(finale.FCString("DumpText"))
225226
dumper:SetWidth(70)
226-
dlg:RegisterHandleControlEvent(dumper, function(control)
227+
dlg:RegisterHandleControlEvent(dumper, function(control) -- luacheck: ignore
227228
local range = finale.FCRange()
228229
edit_text:GetSelection(range)
229230
if range.Length == 0 then
@@ -252,15 +253,15 @@ dlg:RegisterHandleControlEvent(dumper, function(control)
252253
local colorizer = dlg:CreateButton(10, 300)
253254
colorizer:SetText(finale.FCString("Sel2Red"))
254255
colorizer:SetWidth(90)
255-
dlg:RegisterHandleControlEvent(colorizer, function(control)
256+
dlg:RegisterHandleControlEvent(colorizer, function(control) -- luacheck: ignore
256257
local range = finale.FCRange()
257258
edit_text:GetSelection(range)
258259
edit_text:SetTextColorInRange(247, 0, 0, range)
259260
end)
260261
local find2color = dlg:CreateButton(110, 300)
261262
find2color:SetText(finale.FCString("Find2Green"))
262263
find2color:SetWidth(90)
263-
dlg:RegisterHandleControlEvent(find2color, function(control)
264+
dlg:RegisterHandleControlEvent(find2color, function(control) -- luacheck: ignore
264265
local str = finale.FCString()
265266
findtext:GetText(str)
266267
local options = 0
@@ -282,7 +283,7 @@ dlg:RegisterHandleControlEvent(find2color, function(control)
282283
local colorreporter = dlg:CreateButton(210, 300)
283284
colorreporter:SetText(finale.FCString("Color Starts"))
284285
colorreporter:SetWidth(90)
285-
dlg:RegisterHandleControlEvent(colorreporter, function(control)
286+
dlg:RegisterHandleControlEvent(colorreporter, function(control) -- luacheck: ignore
286287
local ranges = edit_text:CreateTextColorChanges()
287288
if not ranges then
288289
print("No colors returned.")
@@ -299,7 +300,7 @@ dlg:RegisterHandleControlEvent(colorreporter, function(control)
299300
end)
300301
local colorreverter = dlg:CreateButton(310, 300)
301302
colorreverter:SetText(finale.FCString("Default"))
302-
dlg:RegisterHandleControlEvent(colorreverter, function(control)
303+
dlg:RegisterHandleControlEvent(colorreverter, function(control) -- luacheck: ignore
303304
edit_text:SetFont(finale.FCFontInfo("Arial", 12))
304305
--local range = finale.FCRange()
305306
--edit_text:GetTotalTextRange(range)
@@ -314,11 +315,10 @@ curr_sel:SetWidth(200)
314315
dlg:RegisterTextSelectionChanged(function(control)
315316
local fstr = finale.FCString()
316317
control:GetSelectedText(fstr) -- if no selection, fstr is unchanged and empty
317-
local seltext = fstr.LuaString
318-
--print("Selected Text: "..seltext)
318+
--print("Selected Text: "..fstr.LuaString)
319319
curr_sel:SetText(fstr)
320320
end)
321-
local ok = dlg:CreateOkButton()
321+
dlg:CreateOkButton()
322322
dlg:RegisterInitWindow(function()
323323
if init_with_rtf then
324324
edit_text:SetFont(finale.FCFontInfo("Arial", 12))

src/transpose_chromatic.lua

+5-3
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,12 @@ function plugindef(locale)
4242
menu = "Transponieren chromatisch",
4343
desc = "Chromatische Transposition des ausgewählten Abschnittes (unterstützt Mikrotonsysteme)."
4444
}
45-
local t = locale and loc[locale:sub(1,2)] or loc.en
45+
local t = locale and loc[locale:sub(1, 2)] or loc.en
4646
return t.menu .. "...", t.menu, t.desc
4747
end
4848

49+
-- luacheck: ignore 11./global_dialog
50+
4951
if not finenv.IsRGPLua then
5052
local path = finale.FCString()
5153
path:SetRunningLuaFolderPath()
@@ -274,7 +276,7 @@ function create_dialog_box()
274276
:_FallbackCall("AssureNoHorizontalOverlap", nil, dialog:GetControl("direction_label"), 5)
275277
current_y = current_y + y_increment
276278
-- interval
277-
static = dialog:CreateStatic(0, current_y + 2, "interval_label")
279+
dialog:CreateStatic(0, current_y + 2, "interval_label")
278280
:SetText(loc.localize("Interval"))
279281
:SetWidth(x_increment - 5)
280282
:_FallbackCall("DoAutoResizeWidth", nil, true)
@@ -310,7 +312,7 @@ function create_dialog_box()
310312
:SetWidth(140)
311313
:SetCheck(0)
312314
:_FallbackCall("DoAutoResizeWidth", nil, true)
313-
current_y = current_y + y_increment
315+
current_y = current_y + y_increment -- luacheck: ignore
314316
-- OK/Cxl
315317
dialog:CreateOkButton()
316318
:SetText(loc.localize(loc.localize("OK")))

0 commit comments

Comments
 (0)