Keep Source and Test module names in sync #101
grrinchas
started this conversation in
Rule ideas
Replies: 1 comment
-
I just wanted to throw in another layout which I have adopted in my projects, I have a
So I would be in favour of this rule with suffix vs prefix flavours. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What the rule should do:
Report Test modules which does not have corresponding Source module.
What problems does it solve:
I had this problem when you create a module, then write tests for that module, and then you forget about that module. Later you decide to move the module into different folder or rename it. But you forget to do the same for the corresponding Test module. So your Test modules and Source modules go out of sync. Therefore,
Example of things the rule would report:
In this case, rule would expect
Public.User.elm
to be present.Example of things the rule would not report:
Trivia:
In most cases when you create a module you have the corresponding test module with the same name but with
Test
suffix. This rule enforces the standard.NOTE! This is not about making sure that every Source module must have the Test module. But is that if you do have, then make sure that Test module name is consistent.
When (not) to enable this rule:
I see no reason why it should be disabled. Besides, having this rule, would allow us to write other rules which depends on this one.
I am looking for:
I have already written this rule and been using for a while. Wondering if I should publish it or not? And if publish, whether under my own name or more official one?
Beta Was this translation helpful? Give feedback.
All reactions