Skip to content

Commit

Permalink
remove message test
Browse files Browse the repository at this point in the history
  • Loading branch information
erwan-serandour committed Dec 17, 2024
1 parent 8cbf08d commit 82cab54
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ public void visitCompilationUnit(CompilationUnitTree tree) {
if (!dir.endsWith(packageName)) {
String dirWithoutDots = dir.replace(".", File.separator);
int srcIndex = dir.indexOf("src");
String truncatedPath = "/" + dir.substring(srcIndex == -1 ? 0 : srcIndex);
String issueMessage = MessageFormat.format(MESSAGE, truncatedPath, packageName);
String truncatedPath = dir.substring(srcIndex == -1 ? 0 : srcIndex);
String issueMessage = MessageFormat.format(MESSAGE, truncatedPath, packageName.replace(File.separator, "."));

if (dirWithoutDots.endsWith(packageName)) {
context.reportIssue(this, packageDeclaration.packageName(), issueMessage + "(Do not use dots in directory names).");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.foo.mismatchPackage; // Noncompliant {{File path "/src/test/files/checks/mismatchPackage" should match package name "org/foo/mismatchPackage". Move file or change package name.}}
package org.foo.mismatchPackage; // Noncompliant
// ^^^^^^^^^^^^^^^^^^^^^^^

class Mismatch {}

0 comments on commit 82cab54

Please sign in to comment.