From f4dec41d10952433863e02f3531871eaa1cee150 Mon Sep 17 00:00:00 2001 From: WebFreak001 Date: Fri, 26 Dec 2025 22:35:02 +0100 Subject: [PATCH 1/4] Upgrade libdparse and DCD --- DCD | 2 +- dub.json | 2 +- dub.selections.json | 4 ++-- libdparse | 2 +- src/dscanner/analysis/mismatched_args.d | 12 +++++------- src/dscanner/analysis/unused.d | 8 ++++---- 6 files changed, 14 insertions(+), 16 deletions(-) diff --git a/DCD b/DCD index 1c60c548..a0441ba8 160000 --- a/DCD +++ b/DCD @@ -1 +1 @@ -Subproject commit 1c60c5480f70db568279e4637a5033953c777406 +Subproject commit a0441ba8c5c7d841e481413a56a1ebe4f8364811 diff --git a/dub.json b/dub.json index 72cb2697..739c83a5 100644 --- a/dub.json +++ b/dub.json @@ -12,7 +12,7 @@ ], "dependencies": { "libdparse": ">=0.23.1 <0.26.0", - "dcd:dsymbol": ">=0.16.0-beta.2 <0.17.0", + "dcd:dsymbol": ">=0.16.2 <0.17.0", "inifiled": "~>1.3.1", "emsi_containers": "~>0.9.0", "libddoc": "~>0.8.0" diff --git a/dub.selections.json b/dub.selections.json index 7f41c15f..d0cfbebb 100644 --- a/dub.selections.json +++ b/dub.selections.json @@ -1,12 +1,12 @@ { "fileVersion": 1, "versions": { - "dcd": "0.16.0-beta.2", + "dcd": "0.16.2", "dsymbol": "0.13.0", "emsi_containers": "0.9.0", "inifiled": "1.3.3", "libddoc": "0.8.0", - "libdparse": "0.25.0", + "libdparse": "0.25.1", "stdx-allocator": "2.77.5" } } diff --git a/libdparse b/libdparse index f8a6c285..6b348eb5 160000 --- a/libdparse +++ b/libdparse @@ -1 +1 @@ -Subproject commit f8a6c28589aae180532fb460a1b22e92a0978292 +Subproject commit 6b348eb57922fc8fc77d7b6a02c1ab8afd180b8f diff --git a/src/dscanner/analysis/mismatched_args.d b/src/dscanner/analysis/mismatched_args.d index db75eb4c..5cdbea16 100644 --- a/src/dscanner/analysis/mismatched_args.d +++ b/src/dscanner/analysis/mismatched_args.d @@ -1,12 +1,12 @@ module dscanner.analysis.mismatched_args; +import dparse.ast; +import dparse.lexer : tok, Token; import dscanner.analysis.base; import dscanner.utils : safeAccess; +import dsymbol.builtin.names; import dsymbol.scope_; import dsymbol.symbol; -import dparse.ast; -import dparse.lexer : tok, Token; -import dsymbol.builtin.names; /// Checks for mismatched argument and parameter names final class MismatchedArgumentCheck : BaseAnalyzer @@ -22,8 +22,6 @@ final class MismatchedArgumentCheck : BaseAnalyzer override void visit(const FunctionCallExpression fce) { import std.typecons : scoped; - import std.algorithm.iteration : each, map; - import std.array : array; if (fce.arguments is null) return; @@ -53,7 +51,7 @@ final class MismatchedArgumentCheck : BaseAnalyzer { // The cast is a hack because .array() confuses the compiler's overload // resolution code. - const(istring)[] params = sym is null ? [] : sym.argNames[].map!(a => cast() a).array(); + const(istring)[] params = sym is null ? [] : sym.argNames; const ArgMismatch[] mismatches = compareArgsToParams(params, args); if (mismatches.length == 0) matched = true; @@ -251,8 +249,8 @@ unittest unittest { + import dscanner.analysis.config : Check, disabledConfig, StaticAnalysisConfig; import dscanner.analysis.helpers : assertAnalyzerWarnings; - import dscanner.analysis.config : StaticAnalysisConfig, Check, disabledConfig; import std.stdio : stderr; StaticAnalysisConfig sac = disabledConfig(); diff --git a/src/dscanner/analysis/unused.d b/src/dscanner/analysis/unused.d index 9089134f..7afd6da1 100644 --- a/src/dscanner/analysis/unused.d +++ b/src/dscanner/analysis/unused.d @@ -7,10 +7,10 @@ module dscanner.analysis.unused; import dparse.ast; import dparse.lexer; import dscanner.analysis.base; -import std.container; -import std.regex : Regex, regex, matchAll; import dsymbol.scope_ : Scope; import std.algorithm : all; +import std.container; +import std.regex : matchAll, regex, Regex; /** * Checks for unused variables. @@ -86,10 +86,10 @@ abstract class UnusedIdentifierCheck : BaseAnalyzer override void visit(const SwitchStatement switchStatement) { - if (switchStatement.expression !is null) + if (switchStatement.condition !is null && switchStatement.condition.expression !is null) { interestDepth++; - switchStatement.expression.accept(this); + switchStatement.condition.expression.accept(this); interestDepth--; } switchStatement.accept(this); From fb4b2d41ef1bb572e70f6d38c3311d07255bee03 Mon Sep 17 00:00:00 2001 From: WebFreak001 Date: Fri, 26 Dec 2025 22:36:52 +0100 Subject: [PATCH 2/4] fix macOS CI --- .github/workflows/default.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/default.yml b/.github/workflows/default.yml index 3061cd9b..bb6341e4 100644 --- a/.github/workflows/default.yml +++ b/.github/workflows/default.yml @@ -72,7 +72,7 @@ jobs: - compiler: dmd: dmd - host: macos-13 + host: macos-15-intel build: type: 'dub' version: 'current' From 7337f49ce8eb37afc9bb006d6b3684b369a538f7 Mon Sep 17 00:00:00 2001 From: WebFreak001 Date: Fri, 26 Dec 2025 22:38:19 +0100 Subject: [PATCH 3/4] upgrade minimum libdparse --- dub.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dub.json b/dub.json index 739c83a5..d70c54da 100644 --- a/dub.json +++ b/dub.json @@ -11,7 +11,7 @@ "built_with_dub" ], "dependencies": { - "libdparse": ">=0.23.1 <0.26.0", + "libdparse": ">=0.24.0 <0.26.0", "dcd:dsymbol": ">=0.16.2 <0.17.0", "inifiled": "~>1.3.1", "emsi_containers": "~>0.9.0", From 523f33d52db77d55fe294d03ad1478f27c0faa8c Mon Sep 17 00:00:00 2001 From: WebFreak001 Date: Fri, 26 Dec 2025 22:41:51 +0100 Subject: [PATCH 4/4] drop macOS intel --- .github/workflows/default.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/default.yml b/.github/workflows/default.yml index bb6341e4..6ab9c296 100644 --- a/.github/workflows/default.yml +++ b/.github/workflows/default.yml @@ -70,13 +70,6 @@ jobs: include: - { do_report: 1, build: { type: dub, version: 'current' }, host: 'ubuntu-22.04', compiler: { version: dmd-latest, dmd: dmd } } - - compiler: - dmd: dmd - host: macos-15-intel - build: - type: 'dub' - version: 'current' - runs-on: ${{ matrix.host }} steps: