Skip to content

Commit 7b7a1ad

Browse files
committed
Merge branch 'topic/508' into 'master'
Do not fail when importing file already present in rules search paths Closes #508 See merge request eng/libadalang/langkit-query-language!489
2 parents d42287f + 4c37ca7 commit 7b7a1ad

File tree

7 files changed

+61
-1
lines changed

7 files changed

+61
-1
lines changed

lkql_jit/language/src/main/java/com/adacore/lkql_jit/nodes/declarations/Import.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,11 @@ private File getModuleFile() {
170170
if (dir != null && dir.isDirectory()) {
171171
File moduleTry = new File(dir, moduleFileName);
172172
if (moduleTry.isFile() && moduleTry.canRead()) {
173-
matchingFiles.add(moduleTry);
173+
try {
174+
matchingFiles.add(moduleTry.getCanonicalFile());
175+
} catch (IOException e) {
176+
throw LKQLRuntimeException.fromJavaException(e, this);
177+
}
174178
}
175179
}
176180
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
project Prj is
2+
end Prj;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import mylib
2+
3+
@check(help="help", message="message")
4+
fun my_rule(node) =
5+
node is DefiningName
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#mylib
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
procedure Test is -- FLAG
2+
begin
3+
null;
4+
end;
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
1. Summary
2+
3+
fully compliant sources : 0
4+
sources with exempted violations only : 0
5+
sources with non-exempted violations : 1
6+
unverified sources : 0
7+
total sources : 1
8+
ignored sources : 0
9+
10+
non-exempted violations : 1
11+
rule exemption warnings : 0
12+
compilation errors : 0
13+
exempted violations : 0
14+
internal errors : 0
15+
16+
2. Exempted Coding Standard Violations
17+
18+
no exempted violations detected
19+
20+
3. Non-exempted Coding Standard Violations
21+
22+
test.adb:1:11: rule violation: message
23+
24+
4. Rule exemption problems
25+
26+
no rule exemption problems detected
27+
28+
5. Language violations
29+
30+
no language violations detected
31+
32+
6. Gnatcheck internal errors
33+
34+
no internal error detected
35+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
driver: 'gnatcheck'
2+
description: |
3+
Do not raise an error when the imported file is in one of the lkql rules
4+
search path.
5+
project: 'prj.gpr'
6+
rules:
7+
- +Rmy_rule
8+
rules_dirs:
9+
- rules

0 commit comments

Comments
 (0)