New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RDY] Luacheck inlining #2152
[RDY] Luacheck inlining #2152
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice cleaning
-- W212: unused argument XYZ | ||
-- W231: variable XYZ is never accessed | ||
-- W542: empty if branch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd keep these comment lines incase they end up being needed in the future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what luacheck's documentation is for - https://luacheck.readthedocs.io/en/stable/warnings.html
I agree with removal.
@@ -46,7 +46,7 @@ local function action_seek_reception_start(action, humanoid) | |||
|
|||
-- Go through all receptions desks. | |||
for _, desk in ipairs(humanoid.hospital:findReceptionDesks()) do | |||
if (not desk.receptionist and not desk.reserved_for) then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good candidate to rewrite. if desk.receptionist or desk.reserved_for then
Just a thought, but if you're leaning towards luacheck inlining (actually gives the ignore context imo) maybe it would be noted in the .luacheck file that this method should be preferred |
I rewrote some of the simpler empty ifs, the others will come later. There's now a note on the wiki page for Coding Conventions, and I'll add a line to luacheckrc when that bottom section is cleared. |
@@ -811,7 +811,7 @@ end | |||
--!return (array of {xpos, ypos} tables) Coordinates to draw the selected sprite. | |||
function UIMapEditor:getDrawPoints() | |||
if self.cursor.state == "disabled" then | |||
-- Nothing to compute, drop to bottom {} return. | |||
return {} -- Nothing to compute, return early |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use 2 space indenting.
Ready. |
Holding due to release |
Describe what the proposed change does
These commits can be squashed, they're only this way for some clarity.