Skip to content

Make luacheck >= 0.26 happy#9174

Merged
NiLuJe merged 1 commit into
koreader:masterfrom
NiLuJe:luacheck-0.26
Jun 11, 2022
Merged

Make luacheck >= 0.26 happy#9174
NiLuJe merged 1 commit into
koreader:masterfrom
NiLuJe:luacheck-0.26

Conversation

@NiLuJe

@NiLuJe NiLuJe commented Jun 6, 2022

Copy link
Copy Markdown
Member

Re: koreader/koreader-base#1487


This change is Reviewable

@NiLuJe NiLuJe requested review from Frenzie, pazos and poire-z as code owners June 6, 2022 01:58
@Frenzie

Frenzie commented Jun 6, 2022

Copy link
Copy Markdown
Member

I'm afraid I don't like this PR much. I definitely appreciate the effort though. :-)

With regard to the _ stuff, I haven't found the time to submit a patch to upstream luacheck to make the specifics configurable, but I don't think changing what's pos everywhere to coords is helpful when reading in the way _pos is. Perhaps coords is a better name, but then logically it should be _coords or coords_ because pos will also have been changed to coords.

And I'm not at all fond of the logic changes either. The dumb algorithm that should keep its stupid mouth shut about which way we decide the logic is most expressive and comprehensible about its intent.

Related: https://github.com/awesomeWM/awesome/issues/3627

@Frenzie

Frenzie commented Jun 6, 2022

Copy link
Copy Markdown
Member

I take back what I said about the logic changes. I think those look like improvements in clarity, meaning I think luacheck makes sense there and no global override is necessary in my eyes, only (theoretically) local ones.

Edit: I was mainly responding to the "make luacheck happy" commit message rather than to the actual changes on that one, mea culpa.

@poire-z

poire-z commented Jun 6, 2022

Copy link
Copy Markdown
Contributor

Well, when reading first @Frenzie 's comment, I was fearing there would be lots of changes in many of (my) places :)
But it's very limited, so I won't mind.
(I still prefer reading _self than this - with _self, you know it refers to some lua object that might not be the current self. With this, I feel like having a journey into some other language like Javascript or Java :)
May be a one line comment just in readerhighlight.lua above the first use of this saying this will be actually our self here - might help future readers of this bit of code (more popuular than CreDocument)

@Frenzie

Frenzie commented Jun 6, 2022

Copy link
Copy Markdown
Member

I'd rather use self_ iff [sic] we decide we want to use the _self style prefix to mark unused.

@NiLuJe

NiLuJe commented Jun 6, 2022

Copy link
Copy Markdown
Member Author

I'd rather use self_ iff [sic] we decide we want to use the _self style prefix to mark unused.

That would have been my choice if I hadn't already peppered a few this across the codebase ;p.

@Frenzie Frenzie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would have been my choice if I hadn't already peppered a few this across the codebase ;p.

Seeing this feels a bit foreign (perhaps more like JS, although in JS I used to do a lot of self = this to keep a reference because this can be quite variable), but if you say the code is already "peppered" with it. ;-)

@NiLuJe NiLuJe merged commit dcb11c2 into koreader:master Jun 11, 2022
@Frenzie Frenzie added this to the 2022.06 milestone Jun 11, 2022
rjd22 pushed a commit that referenced this pull request Nov 7, 2022
@benoit-pierre benoit-pierre mentioned this pull request Apr 13, 2024
0xstillb pushed a commit to 0xstillb/koreader-thai that referenced this pull request May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants