From be87fb27a099741783a991873503e5c9d3996d49 Mon Sep 17 00:00:00 2001 From: Frans de Jonge Date: Mon, 26 Aug 2019 15:49:50 +0200 Subject: [PATCH] [chore] Convert a couple more todos (#5267) Cf. . Also update check. --- .ci/check.sh | 2 +- frontend/apps/reader/modules/readerrolling.lua | 2 +- frontend/device/gesturedetector.lua | 2 +- frontend/device/kindle/device.lua | 4 ++-- frontend/document/pdfdocument.lua | 2 +- frontend/ui/widget/container/framecontainer.lua | 4 ++-- frontend/ui/widget/linewidget.lua | 2 +- frontend/ui/widget/menu.lua | 4 ++-- frontend/ui/widget/textwidget.lua | 2 +- plugins/send2ebook.koplugin/main.lua | 2 +- 10 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.ci/check.sh b/.ci/check.sh index d62f09a7f..6646fb0e2 100755 --- a/.ci/check.sh +++ b/.ci/check.sh @@ -28,7 +28,7 @@ if [ "${tab_detected}" ]; then exit 1 fi -untagged_todo=$(grep -Pin "[^\-]\-\-\s+@?(todo|fixme|warning)" --include \*.lua --exclude={dateparser.lua,xml.lua} --recursive {reader,setupkoenv,datastorage}.lua frontend plugins spec || true) +untagged_todo=$(grep -Pin "[^\-]\-\-(\s+)?@?(todo|fixme|warning)" --include \*.lua --exclude={dateparser.lua,xml.lua} --recursive {reader,setupkoenv,datastorage}.lua frontend plugins spec || true) if [ "${untagged_todo}" ]; then echo -e "\\n${ANSI_RED}Warning: possible improperly tagged todo, fixme or warning detected." echo -e "\\n${ANSI_RED} use --- followed by @todo, @fixme or @warning." diff --git a/frontend/apps/reader/modules/readerrolling.lua b/frontend/apps/reader/modules/readerrolling.lua index ada4a9e12..e3193a9af 100644 --- a/frontend/apps/reader/modules/readerrolling.lua +++ b/frontend/apps/reader/modules/readerrolling.lua @@ -642,7 +642,7 @@ function ReaderRolling:onPanning(args, _) end function ReaderRolling:onZoom() - --@TODO re-read doc_height info after font or lineheight changes 05.06 2012 (houqp) + --- @todo Re-read doc_height info after font or lineheight changes. 05.06 2012 (houqp) self:updatePos() end diff --git a/frontend/device/gesturedetector.lua b/frontend/device/gesturedetector.lua index db00b4711..32e69bd56 100644 --- a/frontend/device/gesturedetector.lua +++ b/frontend/device/gesturedetector.lua @@ -228,7 +228,7 @@ Warning! this method won't update self.state, you need to do it in each state method! --]] function GestureDetector:switchState(state_new, tev, param) - --@TODO do we need to check whether state is valid? (houqp) + --- @todo Do we need to check whether state is valid? (houqp) return self[state_new](self, tev, param) end diff --git a/frontend/device/kindle/device.lua b/frontend/device/kindle/device.lua index d0ebdf103..731f73413 100644 --- a/frontend/device/kindle/device.lua +++ b/frontend/device/kindle/device.lua @@ -192,7 +192,7 @@ end function Kindle:usbPlugOut() -- NOTE: See usbPlugIn(), we don't have anything fancy to do here either. - --@TODO signal filemanager for file changes 13.06 2012 (houqp) + --- @todo signal filemanager for file changes 13.06 2012 (houqp) self.charging_mode = false end @@ -211,7 +211,7 @@ function Kindle:ambientBrightnessLevel() return 4 end --- Make sure the C BB cannot be used on devices with a 4bpp fb +--- Makes sure the C BB cannot be used on devices with a 4bpp fb. function Kindle:blacklistCBB() local ffi = require("ffi") local dummy = require("ffi/posix_h") diff --git a/frontend/document/pdfdocument.lua b/frontend/document/pdfdocument.lua index e7421d6eb..2349531dd 100644 --- a/frontend/document/pdfdocument.lua +++ b/frontend/document/pdfdocument.lua @@ -118,7 +118,7 @@ function PdfDocument:getUsedBBox(pageno) if used.x1 > pwidth then used.x1 = pwidth end if used.y0 < 0 then used.y0 = 0 end if used.y1 > pheight then used.y1 = pheight end - --@TODO give size for cacheitem? 02.12 2012 (houqp) + --- @todo Give size for cacheitem? 02.12 2012 (houqp) Cache:insert(hash, CacheItem:new{ ubbox = used, }) diff --git a/frontend/ui/widget/container/framecontainer.lua b/frontend/ui/widget/container/framecontainer.lua index 15731b0d1..5e5a2ce1f 100644 --- a/frontend/ui/widget/container/framecontainer.lua +++ b/frontend/ui/widget/container/framecontainer.lua @@ -62,14 +62,14 @@ function FrameContainer:paintTo(bb, x, y) local container_width = self.width or my_size.w local container_height = self.height or my_size.h - --@TODO get rid of margin here? 13.03 2013 (houqp) + --- @todo get rid of margin here? 13.03 2013 (houqp) if self.background then bb:paintRoundedRect(x, y, container_width, container_height, self.background, self.radius) end if self.inner_bordersize > 0 then - -- NOTE: This doesn't actually support radius, it'll always be a square. + --- @warning This doesn't actually support radius, it'll always be a square. bb:paintInnerBorder(x + self.margin, y + self.margin, container_width - self.margin * 2, container_height - self.margin * 2, diff --git a/frontend/ui/widget/linewidget.lua b/frontend/ui/widget/linewidget.lua index 3534e9c8b..d3110de19 100644 --- a/frontend/ui/widget/linewidget.lua +++ b/frontend/ui/widget/linewidget.lua @@ -9,7 +9,7 @@ local LineWidget = Widget:new{ style = "solid", background = Blitbuffer.COLOR_BLACK, dimen = nil, - --@TODO replay dirty hack here 13.03 2013 (houqp) + --- @todo Replay dirty hack here 13.03 2013 (houqp). empty_segments = nil, } diff --git a/frontend/ui/widget/menu.lua b/frontend/ui/widget/menu.lua index 7e717c692..b819a1504 100644 --- a/frontend/ui/widget/menu.lua +++ b/frontend/ui/widget/menu.lua @@ -57,7 +57,7 @@ function ItemShortCutIcon:init() background = Blitbuffer.COLOR_LIGHT_GRAY end - --@TODO calculate font size by icon size 01.05 2012 (houqp) + --- @todo Calculate font size by icon size 01.05 2012 (houqp). local sc_face if self.key:len() > 1 then sc_face = Font:getFace("ffont", 14) @@ -673,7 +673,7 @@ function Menu:init() is_enter_default = true, callback = function() for k, v in ipairs(self.item_table) do - --TODO support utf8 lowercase + --- @todo Support utf8 lowercase. local filename = util.basename(v.path):lower() local search_string = self.page_info_text.input_dialog:getInputText():lower() local i, _ = filename:find(search_string) diff --git a/frontend/ui/widget/textwidget.lua b/frontend/ui/widget/textwidget.lua index 9354d975e..f1292902f 100644 --- a/frontend/ui/widget/textwidget.lua +++ b/frontend/ui/widget/textwidget.lua @@ -94,7 +94,7 @@ function TextWidget:paintTo(bb, x, y) --self:_render() --end --bb:blitFrom(self._bb, x, y, 0, 0, self._length, self._bb:getHeight()) - --@TODO Don't use kerning for monospaced fonts. (houqp) + --- @todo Don't use kerning for monospaced fonts. (houqp) if self.max_width and RenderText:sizeUtf8Text(0, Screen:getWidth(), self.face, self.text, true, self.bold).x > self.max_width then self.text = RenderText:truncateTextByWidth(self.text, self.face, self.max_width, true) end diff --git a/plugins/send2ebook.koplugin/main.lua b/plugins/send2ebook.koplugin/main.lua index baf941b04..5155c5745 100644 --- a/plugins/send2ebook.koplugin/main.lua +++ b/plugins/send2ebook.koplugin/main.lua @@ -150,7 +150,7 @@ function Send2Ebook:process() if total_entries > 1 then total_entries = total_entries -2 end --remove result "../" (upper folder) and "./" (current folder) for idx, ftp_file in ipairs(ftp_files_table) do logger.dbg("Send2Ebook: processing ftp_file:", ftp_file) - --TODO recursive download folders + --- @todo Recursive download folders. if ftp_file["type"] == "file" then info = InfoMessage:new{ text = T(_("Processing %1/%2"), count, total_entries) }