jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/392369 )

Change subject: Adding .luachecrc with a minimum configuration
......................................................................


Adding .luachecrc with a minimum configuration

The linter "luacheck" need a special configuration file to make it stop
complaining. In addition to the configuration file a few changes are
made to remove specific lints, thus removing the the need for inline
options and file-specific handling.

This does not add the linter to the toolchain, it is only for
in-editor use.

Bug: T180925
Change-Id: I091b46fdf358c36f02b36a65223f643a2c9e41b2
---
A .luacheckrc
M client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua
2 files changed, 16 insertions(+), 12 deletions(-)

Approvals:
  WMDE-leszek: Looks good to me, approved
  jenkins-bot: Verified
  Thiemo Mättig (WMDE): Looks good to me, but someone else must approve



diff --git a/.luacheckrc b/.luacheckrc
new file mode 100644
index 0000000..38b8a16
--- /dev/null
+++ b/.luacheckrc
@@ -0,0 +1,4 @@
+stds.scribunto = {
+       globals = { "mw", "mw_interface" }
+}
+std = "min+scribunto"
diff --git a/client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua 
b/client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua
index 989a572..6c2ce4d 100644
--- a/client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua
+++ b/client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua
@@ -9,7 +9,7 @@
 ]]
 
 local php = mw_interface
-local entity = {}
+local Entity = {}
 local metatable = {}
 local methodtable = {}
 local util = require 'libraryUtil'
@@ -19,7 +19,7 @@
 metatable.__index = methodtable
 
 -- Claim ranks (Claim::RANK_* in PHP)
-entity.claimRanks = {
+Entity.claimRanks = {
        RANK_TRUTH = 3,
        RANK_PREFERRED = 2,
        RANK_NORMAL = 1,
@@ -46,7 +46,7 @@
        entity.claims = {}
 
        local pseudoClaimsMetatable = {}
-       pseudoClaimsMetatable.__index = function( emptyTable, propertyId )
+       pseudoClaimsMetatable.__index = function( _, propertyId )
                if isValidPropertyId( propertyId ) then
                        -- Only attempt to track the usage if we have a valid 
property id.
                        php.addStatementUsage( entity.id, propertyId )
@@ -55,18 +55,18 @@
                return actualEntityClaims[propertyId]
        end
 
-       pseudoClaimsMetatable.__newindex = function( emptyTable, propertyId, 
data )
+       pseudoClaimsMetatable.__newindex = function( _, _, _ )
                error( 'Entity cannot be modified' )
        end
 
-       local logNext = function( emptyTable, propertyId )
+       local logNext = function( _, propertyId )
                if isValidPropertyId( propertyId ) then
                        php.addStatementUsage( entity.id, propertyId )
                end
                return next( actualEntityClaims, propertyId )
        end
 
-       pseudoClaimsMetatable.__pairs = function( emptyTable )
+       pseudoClaimsMetatable.__pairs = function( _ )
                return logNext, {}, nil
        end
 
@@ -77,7 +77,7 @@
 -- Create new entity object from given data
 --
 -- @param {table} data
-entity.create = function( data )
+Entity.create = function( data )
        if type( data ) ~= 'table' then
                error( 'Expected a table obtained via 
mw.wikibase.getEntityObject, got ' .. type( data ) .. ' instead' )
        end
@@ -211,7 +211,7 @@
        local statements = {}
        local bestRank = 'normal'
 
-       for k, statement in pairs( entity.claims[propertyId] ) do
+       for _, statement in pairs( entity.claims[propertyId] ) do
                if statement.rank == bestRank then
                        statements[#statements + 1] = statement
                elseif statement.rank == 'preferred' then
@@ -233,7 +233,7 @@
        local properties = {}
 
        local n = 0
-       for k, v in pairs( entity.claims ) do
+       for k, _ in pairs( entity.claims ) do
                n = n + 1
                properties[n] = k
        end
@@ -306,8 +306,8 @@
        );
 end
 
-mw.wikibase.entity = entity
-package.loaded['mw.wikibase.entity'] = entity
+mw.wikibase.entity = Entity
+package.loaded['mw.wikibase.entity'] = Entity
 mw_interface = nil
 
-return entity
+return Entity

-- 
To view, visit https://gerrit.wikimedia.org/r/392369
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I091b46fdf358c36f02b36a65223f643a2c9e41b2
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: John Erling Blad <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: Eranroz <[email protected]>
Gerrit-Reviewer: Hoo man <[email protected]>
Gerrit-Reviewer: Jackmcbarn <[email protected]>
Gerrit-Reviewer: John Erling Blad <[email protected]>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: WMDE-leszek <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to