Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No hyperlinks if whole class violates a rule #61

Closed
uhafner opened this issue Jan 27, 2018 · 1 comment
Closed

No hyperlinks if whole class violates a rule #61

uhafner opened this issue Jan 27, 2018 · 1 comment
Milestone

Comments

@uhafner
Copy link

uhafner commented Jan 27, 2018

The following rule produces an assertion error (in IntelliJ) that contains only text, no hyperlinks to the classes.

    /**
     * Test classes should not be public (Junit 5).
     */
    @Test
    void shouldNotUsePublicInTestCases() {
        JavaClasses classes = new ClassFileImporter().importPackages("edu.hm.hafner");

        ArchRule noPublicClasses = noClasses().that().haveSimpleNameEndingWith("Test")
                .should().bePublic();

        noPublicClasses.check(classes);
    }

Produces the output (example):

java.lang.AssertionError: Architecture Violation [Priority: MEDIUM] - Rule 'no classes that have simple name ending with 'Test' should be public' was violated (71 times):
class edu.hm.hafner.ArchitectureRulesTest has modifier PUBLIC
class edu.hm.hafner.analysis.AbstractParserTest has modifier PUBLIC
class edu.hm.hafner.analysis.IssueFilterTest has modifier PUBLIC
class edu.hm.hafner.analysis.IssueTest has modifier PUBLIC
class edu.hm.hafner.analysis.parser.AcuCobolParserTest has modifier PUBLIC
class edu.hm.hafner.analysis.parser.AjcParserTest has modifier PUBLIC
class edu.hm.hafner.analysis.parser.AnsibleLintTest has modifier PUBLIC
[...]

Expected result:
each class has a hyperlink (as the other assertion errors from ArchUnit).

@codecholeric
Copy link
Collaborator

Yeah, I remember that I didn't include this back then, cause I wasn't sure, which line number to print. However, I guess (SomeClass.java:0) would be an alright link to just jump to the file... I'll add this with the next release (I think there are more places than this, where it would make sense to add the link, like assignable/implement, where I didn't include it either)

@codecholeric codecholeric added this to the 0.6.0 milestone Jan 28, 2018
@codecholeric codecholeric modified the milestones: 0.6.0, 1.0.0 Feb 23, 2018
@codecholeric codecholeric modified the milestones: 1.0.0, 0.8.0 May 16, 2018
codecholeric added a commit that referenced this issue Feb 21, 2021
…nditions to enable easy navigation via IDE

Resolves: #61
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants