John Erling Blad has uploaded a new change for review. ( 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. This does not add the linter to the toolchain, it is only added for in-editor use. Bug: T180925 Change-Id: I091b46fdf358c36f02b36a65223f643a2c9e41b2 --- A .luacheckrc M client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua 2 files changed, 11 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/69/392369/1 diff --git a/.luacheckrc b/.luacheckrc new file mode 100644 index 0000000..c92e319 --- /dev/null +++ b/.luacheckrc @@ -0,0 +1,5 @@ +stds.scribunto = { + globals = {"mw", "mw_interface"}, -- these globals can be set and accessed. +} +std = "min+scribunto" +files["client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua"].ignore = {"431"} diff --git a/client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua b/client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua index 989a572..158d37e 100644 --- a/client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua +++ b/client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua @@ -46,7 +46,7 @@ entity.claims = {} local pseudoClaimsMetatable = {} - pseudoClaimsMetatable.__index = function( emptyTable, propertyId ) + pseudoClaimsMetatable.__index = function( emptyTable, propertyId ) -- luacheck: no unused args 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( emptyTable, propertyId, data ) -- luacheck: no unused args error( 'Entity cannot be modified' ) end - local logNext = function( emptyTable, propertyId ) + local logNext = function( emptyTable, propertyId ) -- luacheck: no unused args if isValidPropertyId( propertyId ) then php.addStatementUsage( entity.id, propertyId ) end return next( actualEntityClaims, propertyId ) end - pseudoClaimsMetatable.__pairs = function( emptyTable ) + pseudoClaimsMetatable.__pairs = function( emptyTable ) -- luacheck: no unused args return logNext, {}, nil 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 -- To view, visit https://gerrit.wikimedia.org/r/392369 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I091b46fdf358c36f02b36a65223f643a2c9e41b2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: John Erling Blad <jeb...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits