diff --git a/.github/workflows/default.yml b/.github/workflows/default.yml index 510d68c..a772353 100644 --- a/.github/workflows/default.yml +++ b/.github/workflows/default.yml @@ -40,6 +40,7 @@ jobs: ] build: [ { type: make }, + { type: dub, version: 'current' }, { type: dub, version: 'min libdparse' }, # Fail due to unresolvable dependencies # { type: dub, version: 'max libdparse' }, @@ -104,14 +105,22 @@ jobs: # Compile D-Scanner and execute all tests using a specific dependency version # Currently skipped for GDC (dub installed from apt-get is broken) - - name: Build and test with dub - if: ${{ matrix.build.type == 'dub' }} + - name: Build and test with dub (min or max libdparse test) + if: ${{ matrix.build.type == 'dub' && matrix.build.version != 'current' }} env: DC: ${{ matrix.compiler.dmd }} run: | rdmd ./d-test-utils/test_with_package.d ${{ matrix.build.version }} -- dub build rdmd ./d-test-utils/test_with_package.d ${{ matrix.build.version }} -- dub test + - name: Build and test with dub (with dub.selections.json) + if: ${{ matrix.build.type == 'dub' && matrix.build.version == 'current' }} + env: + DC: ${{ matrix.compiler.dmd }} + run: | + dub build + dub test + - uses: actions/upload-artifact@v2 with: name: bin-${{matrix.build.type}}-${{matrix.build.version}}-${{ matrix.compiler.dmd }}-${{ matrix.host }} diff --git a/.gitignore b/.gitignore index 1232473..4d65886 100755 --- a/.gitignore +++ b/.gitignore @@ -34,4 +34,3 @@ dsc # Dub stuff .dub -dub.selections.json diff --git a/DCD b/DCD index 4c426d7..4946d49 160000 --- a/DCD +++ b/DCD @@ -1 +1 @@ -Subproject commit 4c426d73d1a7e8428a66eddd4fb98cc70ab1cff8 +Subproject commit 4946d49abdc35810254151923bab30fb3cc2c004 diff --git a/dub.json b/dub.json index c1f7e50..d9dead7 100644 --- a/dub.json +++ b/dub.json @@ -12,7 +12,7 @@ "StdLoggerDisableWarning" ], "dependencies": { - "libdparse": ">=0.20.0 <0.22.0", + "libdparse": ">=0.20.0 <0.23.0", "dcd:dsymbol": ">=0.14.0 <0.16.0", "inifiled": "~>1.3.1", "emsi_containers": "~>0.9.0", diff --git a/dub.selections.json b/dub.selections.json new file mode 100644 index 0000000..dcada97 --- /dev/null +++ b/dub.selections.json @@ -0,0 +1,12 @@ +{ + "fileVersion": 1, + "versions": { + "dcd": "0.15.2", + "dsymbol": "0.13.0", + "emsi_containers": "0.9.0", + "inifiled": "1.3.3", + "libddoc": "0.8.0", + "libdparse": "0.22.0", + "stdx-allocator": "2.77.5" + } +} diff --git a/libdparse b/libdparse index 592ef39..98bf0f4 160000 --- a/libdparse +++ b/libdparse @@ -1 +1 @@ -Subproject commit 592ef39a73a58439afc75a3e6c13a0d87d0b847d +Subproject commit 98bf0f4166578717e0b78472ff5054d6f918e797 diff --git a/src/dscanner/analysis/assert_without_msg.d b/src/dscanner/analysis/assert_without_msg.d index e24c989..e5a15c6 100644 --- a/src/dscanner/analysis/assert_without_msg.d +++ b/src/dscanner/analysis/assert_without_msg.d @@ -30,7 +30,17 @@ final class AssertWithoutMessageCheck : BaseAnalyzer override void visit(const AssertExpression expr) { - if (expr.assertArguments && expr.assertArguments.message is null) + static if (__traits(hasMember, expr.assertArguments, "messageParts")) + { + // libdparse 0.22.0+ + bool hasMessage = expr.assertArguments + && expr.assertArguments.messageParts.length > 0; + } + else + bool hasMessage = expr.assertArguments + && expr.assertArguments.message !is null; + + if (!hasMessage) addErrorMessage(expr.line, expr.column, KEY, MESSAGE); }