Skip to content

ArchUnit does not update lines or method parameters in frozen files #1068

Answered by codecholeric
adavid9 asked this question in Q&A
Discussion options

You must be logged in to vote

As for now, only shifted line numbers are ignored, as you found. If you refactor a method signature or make any other bigger changes, then the output of the rule changes in a way that the rule fails. This is also, because it's fairly difficult to determine automatically, what an "accepted" change should be in all contexts.
So yes, either every time you make such an incompatible change you have to "refreeze" the violations (see the refreeze option) or you can adjust how line matching is performed and adjust it in a way that e.g. method parameters are irrelevant (see ViolationLineMatcher). The latter is pretty much a flexible way to hook in your own implementation in that can say for each t…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by adavid9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants