Skip to content

Commit d5d6920

Browse files
committed
Add dub.selections.json, upgrade libdparse 0.22.0
Note: currently a warning is emitted when building, because dscanner now depends on libdparse 0.22.0, but dsymbol doesn't support it officially yet. We just force it with dub.selections.json to build with 0.22.0 for executable builds.
1 parent 9abcf49 commit d5d6920

File tree

7 files changed

+37
-7
lines changed

7 files changed

+37
-7
lines changed

.github/workflows/default.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
]
4141
build: [
4242
{ type: make },
43+
{ type: dub, version: 'current' },
4344
{ type: dub, version: 'min libdparse' },
4445
# Fail due to unresolvable dependencies
4546
# { type: dub, version: 'max libdparse' },
@@ -104,14 +105,22 @@ jobs:
104105
105106
# Compile D-Scanner and execute all tests using a specific dependency version
106107
# Currently skipped for GDC (dub installed from apt-get is broken)
107-
- name: Build and test with dub
108-
if: ${{ matrix.build.type == 'dub' }}
108+
- name: Build and test with dub (min or max libdparse test)
109+
if: ${{ matrix.build.type == 'dub' && matrix.build.version != 'current' }}
109110
env:
110111
DC: ${{ matrix.compiler.dmd }}
111112
run: |
112113
rdmd ./d-test-utils/test_with_package.d ${{ matrix.build.version }} -- dub build
113114
rdmd ./d-test-utils/test_with_package.d ${{ matrix.build.version }} -- dub test
114115
116+
- name: Build and test with dub (with dub.selections.json)
117+
if: ${{ matrix.build.type == 'dub' && matrix.build.version == 'current' }}
118+
env:
119+
DC: ${{ matrix.compiler.dmd }}
120+
run: |
121+
dub build
122+
dub test
123+
115124
- uses: actions/upload-artifact@v2
116125
with:
117126
name: bin-${{matrix.build.type}}-${{matrix.build.version}}-${{ matrix.compiler.dmd }}-${{ matrix.host }}

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,3 @@ dsc
3434

3535
# Dub stuff
3636
.dub
37-
dub.selections.json

dub.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"StdLoggerDisableWarning"
1313
],
1414
"dependencies": {
15-
"libdparse": ">=0.20.0 <0.22.0",
15+
"libdparse": ">=0.20.0 <0.23.0",
1616
"dcd:dsymbol": ">=0.14.0 <0.16.0",
1717
"inifiled": "~>1.3.1",
1818
"emsi_containers": "~>0.9.0",

dub.selections.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"fileVersion": 1,
3+
"versions": {
4+
"dcd": "0.15.2",
5+
"dsymbol": "0.13.0",
6+
"emsi_containers": "0.9.0",
7+
"inifiled": "1.3.3",
8+
"libddoc": "0.8.0",
9+
"libdparse": "0.22.0",
10+
"stdx-allocator": "2.77.5"
11+
}
12+
}

src/dscanner/analysis/assert_without_msg.d

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,17 @@ final class AssertWithoutMessageCheck : BaseAnalyzer
3030

3131
override void visit(const AssertExpression expr)
3232
{
33-
if (expr.assertArguments && expr.assertArguments.message is null)
33+
static if (__traits(hasMember, expr.assertArguments, "messageParts"))
34+
{
35+
// libdparse 0.22.0+
36+
bool hasMessage = expr.assertArguments
37+
&& expr.assertArguments.messageParts.length > 0;
38+
}
39+
else
40+
bool hasMessage = expr.assertArguments
41+
&& expr.assertArguments.message !is null;
42+
43+
if (!hasMessage)
3444
addErrorMessage(expr.line, expr.column, KEY, MESSAGE);
3545
}
3646

0 commit comments

Comments
 (0)