diff options
| author | A2va <[email protected]> | 2024-02-22 21:59:06 +0100 |
|---|---|---|
| committer | A2va <[email protected]> | 2024-02-22 21:59:06 +0100 |
| commit | 3bf168a2d202e69989302ad1699c6e0d60af5f3f (patch) | |
| tree | 7cb4dc7b2b88c4c017fe2eea7253be270773dae3 /xmake/plugins/format | |
| parent | 8436c243d9515c577bd85577b08dd18965e2d631 (diff) | |
Add all option to format
Diffstat (limited to 'xmake/plugins/format')
| -rw-r--r-- | xmake/plugins/format/main.lua | 10 | ||||
| -rw-r--r-- | xmake/plugins/format/xmake.lua | 1 |
2 files changed, 1 insertions, 10 deletions
diff --git a/xmake/plugins/format/main.lua b/xmake/plugins/format/main.lua index 57c63dda7..66bcebcb3 100644 --- a/xmake/plugins/format/main.lua +++ b/xmake/plugins/format/main.lua @@ -96,19 +96,9 @@ function _get_targets(targetname, group_pattern) if targetname then table.insert(targets_root, project.target(targetname)) else - local depset = hashset.new() - local targets = {} for _, target in pairs(project.targets()) do local group = target:get("group") if (target:is_default() and not group_pattern) or option.get("all") or (group_pattern and group and group:match(group_pattern)) then - for _, depname in ipairs(target:get("deps")) do - depset:insert(depname) - end - table.insert(targets, target) - end - end - for _, target in pairs(targets) do - if not depset:has(target:name()) then table.insert(targets_root, target) end end diff --git a/xmake/plugins/format/xmake.lua b/xmake/plugins/format/xmake.lua index 7979bb211..2acdf7176 100644 --- a/xmake/plugins/format/xmake.lua +++ b/xmake/plugins/format/xmake.lua @@ -28,6 +28,7 @@ task("format") {'s', "style", "kv", nil, "Set the path of .clang-format file, a coding style", values = {"LLVM", "Google", "Chromium", "Mozilla", "WebKit"}}, {nil, "create", "k", nil, "Create a .clang-format file from a coding style"}, + {'a', "all", "k", nil , "Format all targets."}, {'g', "group", "kv", nil, "Format all targets of the given group. It support path pattern matching.", "e.g.", " xmake format -g test", |
