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

Fix false positives with nested modules in no-identical-names rule #123

Merged

Conversation

bmish
Copy link
Member

@bmish bmish commented Nov 23, 2020

Fixes #120.

CC: @mongoose700

@coveralls
Copy link

coveralls commented Nov 23, 2020

Coverage Status

Coverage remained the same at 100.0% when pulling b8b759d on bmish:no-identical-names-nested-modules-fix into c51437c on platinumazure:master.

Copy link
Collaborator

@platinumazure platinumazure left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing! I just have one question about a test case that seems like it should be invalid to me, but it is currently valid. Please let me know what you think.

`,
outdent`
module("name1", function() {
module("name1", function() {});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this should be a valid case. We definitely want to support submodules with the same name under nested modules because there's no chance for ambiguity when you look at the nested module stacks. But I'm not sure that is the case for a nested submodule with the same name as an ancestor module.

What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I'd be open to flagging this case as a violation. But we should do that in a separate PR. My current PR is about fixing false positives whereas this change would be fixing a false negative.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, but would you mind removing this new "valid" test case from this PR in that case? That's just in case I lose track of things and cut a release after merging this PR but before we fix the issue I've raised.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure! I removed this test case to avoid confusion.

@bmish bmish force-pushed the no-identical-names-nested-modules-fix branch from 5c73825 to 43eba2a Compare November 24, 2020 16:58
@bmish bmish force-pushed the no-identical-names-nested-modules-fix branch from 43eba2a to b8b759d Compare November 24, 2020 18:16
Copy link
Collaborator

@platinumazure platinumazure left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

no-identical-names fails on identical names in "cousin" modules
3 participants