diff options
| author | ruki <[email protected]> | 2026-03-29 22:55:28 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2026-03-29 22:55:28 +0800 |
| commit | 8841ed9f7b427896f042abcfb3537dd731f6a923 (patch) | |
| tree | d2cb01d00f1873851e86199deef19dda20c43702 /xmake/plugins | |
| parent | 1bccfc273af2b1d579d033324bca481e15c58653 (diff) | |
improve const limit codes
Diffstat (limited to 'xmake/plugins')
| -rw-r--r-- | xmake/plugins/format/main.lua | 3 | ||||
| -rw-r--r-- | xmake/plugins/pack/deb/main.lua | 3 | ||||
| -rw-r--r-- | xmake/plugins/pack/nsis/main.lua | 3 | ||||
| -rw-r--r-- | xmake/plugins/pack/runself/main.lua | 3 | ||||
| -rw-r--r-- | xmake/plugins/pack/srpm/main.lua | 3 | ||||
| -rw-r--r-- | xmake/plugins/pack/wix/main.lua | 3 | ||||
| -rw-r--r-- | xmake/plugins/project/make/makefile.lua | 6 | ||||
| -rw-r--r-- | xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua | 3 | ||||
| -rw-r--r-- | xmake/plugins/project/vstudio/impl/vs201x_vcxproj_filters.lua | 3 | ||||
| -rw-r--r-- | xmake/plugins/project/vstudio/impl/vsutils.lua | 3 | ||||
| -rw-r--r-- | xmake/plugins/project/vsxmake/getinfo.lua | 3 | ||||
| -rw-r--r-- | xmake/plugins/show/lists/apis.lua | 3 |
12 files changed, 13 insertions, 26 deletions
diff --git a/xmake/plugins/format/main.lua b/xmake/plugins/format/main.lua index 5320df979..fe05d86c6 100644 --- a/xmake/plugins/format/main.lua +++ b/xmake/plugins/format/main.lua @@ -63,8 +63,7 @@ function _get_file_patterns(sourcefiles) if excludes then local _excludes = {} for _, exclude in ipairs(excludes) do - local exclude = exclude - exclude = path.translate(exclude) + local exclude = path.translate(exclude) exclude = path.pattern(exclude) table.insert(_excludes, exclude) end diff --git a/xmake/plugins/pack/deb/main.lua b/xmake/plugins/pack/deb/main.lua index 930dcb225..3f7fa4e82 100644 --- a/xmake/plugins/pack/deb/main.lua +++ b/xmake/plugins/pack/deb/main.lua @@ -207,8 +207,7 @@ function _pack_deb(debuild, package) end) end for _, name in ipairs(specvars_names) do - local name = name - name = name:trim() + local name = name:trim() if specvars_values[name] == nil then local value = specvars[name] if type(value) == "function" then diff --git a/xmake/plugins/pack/nsis/main.lua b/xmake/plugins/pack/nsis/main.lua index f566296c5..420a1458c 100644 --- a/xmake/plugins/pack/nsis/main.lua +++ b/xmake/plugins/pack/nsis/main.lua @@ -284,8 +284,7 @@ function _pack_nsis(makensis, package) table.insert(specvars_names, name) end, {encoding = "ansi"}) for _, name in ipairs(specvars_names) do - local name = name - name = name:trim() + local name = name:trim() if specvars_values[name] == nil then local value = specvars[name] if type(value) == "function" then diff --git a/xmake/plugins/pack/runself/main.lua b/xmake/plugins/pack/runself/main.lua index 32b376684..42eb8bc67 100644 --- a/xmake/plugins/pack/runself/main.lua +++ b/xmake/plugins/pack/runself/main.lua @@ -123,8 +123,7 @@ function _pack_runself(makeself, package) table.insert(specvars_names, name) end) for _, name in ipairs(specvars_names) do - local name = name - name = name:trim() + local name = name:trim() if specvars_values[name] == nil then local value = specvars[name] if type(value) == "function" then diff --git a/xmake/plugins/pack/srpm/main.lua b/xmake/plugins/pack/srpm/main.lua index dec2dfdfa..49e27fca3 100644 --- a/xmake/plugins/pack/srpm/main.lua +++ b/xmake/plugins/pack/srpm/main.lua @@ -219,8 +219,7 @@ function _pack_srpm(rpmbuild, package) table.insert(specvars_names, name) end) for _, name in ipairs(specvars_names) do - local name = name - name = name:trim() + local name = name:trim() if specvars_values[name] == nil then local value = specvars[name] if type(value) == "function" then diff --git a/xmake/plugins/pack/wix/main.lua b/xmake/plugins/pack/wix/main.lua index a3055bc0c..e12461883 100644 --- a/xmake/plugins/pack/wix/main.lua +++ b/xmake/plugins/pack/wix/main.lua @@ -302,8 +302,7 @@ function _pack_wix(wix, package) table.insert(specvars_names, name) end) for _, name in ipairs(specvars_names) do - local name = name - name = name:trim() + local name = name:trim() if specvars_values[name] == nil then local value = specvars[name] if type(value) == "function" then diff --git a/xmake/plugins/project/make/makefile.lua b/xmake/plugins/project/make/makefile.lua index d58db7051..ed179e177 100644 --- a/xmake/plugins/project/make/makefile.lua +++ b/xmake/plugins/project/make/makefile.lua @@ -276,8 +276,7 @@ end -- remove the given files or directories function _add_remove_files(makefile, filedirs, outputdir) for _, filedir in ipairs(filedirs) do - local filedir = filedir - filedir = _get_relative_unix_path(filedir, outputdir) + local filedir = _get_relative_unix_path(filedir, outputdir) makefile:print("\t%s", _get_cmd_rm(filedir)) end end @@ -555,8 +554,7 @@ function _add_build_target(makefile, target, targetflags, outputdir) local objectfiles = target:objectfiles() local objectfiles_translated = {} for _, objectfile in ipairs(objectfiles) do - local objectfile = objectfile - objectfile = _get_relative_unix_path(objectfile, outputdir) + local objectfile = _get_relative_unix_path(objectfile, outputdir) table.insert(objectfiles_translated, objectfile) makefile:write(" " .. objectfile) end diff --git a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua index 78407021e..f1f44c3a8 100644 --- a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua +++ b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua @@ -935,8 +935,7 @@ function _make_common_item(vcxprojfile, vsinfo, target, targetinfo) local cstandard local cxxstandard for _, lang in pairs(targetinfo.languages) do - local lang = lang - lang = lang:replace("c++", "cxx", {plain = true}) + local lang = lang:replace("c++", "cxx", {plain = true}) if cxxlangflags[lang] then cxxstandard = cxxlangflags[lang] elseif clangflags[lang] then diff --git a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj_filters.lua b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj_filters.lua index 2ac7aef5d..ed9002662 100644 --- a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj_filters.lua +++ b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj_filters.lua @@ -85,8 +85,7 @@ function _make_filter(filepath, target, vcxprojdir) local files = extraconf.files or "**" local mode = extraconf.mode for _, filepattern in ipairs(files) do - local filepattern = filepattern - filepattern = path.pattern(path.absolute(path.join(rootdir, filepattern))) + local filepattern = path.pattern(path.absolute(path.join(rootdir, filepattern))) if filepath:match(filepattern) then if mode == "plain" then filter = path.normalize(filegroup) diff --git a/xmake/plugins/project/vstudio/impl/vsutils.lua b/xmake/plugins/project/vstudio/impl/vsutils.lua index 984dd609e..30832ae3f 100644 --- a/xmake/plugins/project/vstudio/impl/vsutils.lua +++ b/xmake/plugins/project/vstudio/impl/vsutils.lua @@ -79,8 +79,7 @@ function reset_config_and_caches(mode, arch) end -- merge the project options after default options for name, value in pairs(project.get("config")) do - local value = value - value = table.unwrap(value) + local value = table.unwrap(value) assert(type(value) == "string" or type(value) == "boolean" or type(value) == "number", "set_config(%s): unsupported value type(%s)", name, type(value)) if not config.readonly(name) then config.set(name, value) diff --git a/xmake/plugins/project/vsxmake/getinfo.lua b/xmake/plugins/project/vsxmake/getinfo.lua index 9e943e49c..9395657fd 100644 --- a/xmake/plugins/project/vsxmake/getinfo.lua +++ b/xmake/plugins/project/vsxmake/getinfo.lua @@ -352,8 +352,7 @@ function _make_filter(filepath, target, vcxprojdir) local files = extraconf.files or "**" local mode = extraconf.mode for _, filepattern in ipairs(files) do - local filepattern = filepattern - filepattern = path.pattern(path.absolute(path.join(rootdir, filepattern))) + local filepattern = path.pattern(path.absolute(path.join(rootdir, filepattern))) if filepath:match(filepattern) then if mode == "plain" then filter = path.normalize(filegroup) diff --git a/xmake/plugins/show/lists/apis.lua b/xmake/plugins/show/lists/apis.lua index 84c2ab441..475535a1e 100644 --- a/xmake/plugins/show/lists/apis.lua +++ b/xmake/plugins/show/lists/apis.lua @@ -289,8 +289,7 @@ function script_extension_module_apis() local result = {} local moduledirs = module.directories() for _, moduledir in ipairs(moduledirs) do - local moduledir = moduledir - moduledir = path.absolute(moduledir) + local moduledir = path.absolute(moduledir) local modulefiles = os.files(path.join(moduledir, "**.lua|**/xmake.lua|private/**.lua|core/tools/**.lua|detect/tools/**.lua")) if modulefiles then for _, modulefile in ipairs(modulefiles) do |
