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

Don't import private function name from router #91

Merged
merged 2 commits into from
Sep 11, 2024

Conversation

crbelaus
Copy link
Contributor

Underscored functions are never imported by default. This should fix #90.

If you import the router on main you will see that the parse_options function is imported automatically:

iex(1)> import ErrorTracker.Web.Router
ErrorTracker.Web.Router
iex(2)> h parse_options
No documentation for ErrorTracker.Web.Router.parse_options was found

If you do the same now you will se that the function is not imported and it tries to find it in the Kernel module.

iex(1)> import ErrorTracker.Web.Router
ErrorTracker.Web.Router
iex(2)> h __parse_options__/2
No documentation for Kernel.__parse_options__/2 was found

Underscored functions are never imported by default.
@crbelaus crbelaus self-assigned this Sep 10, 2024
@crbelaus crbelaus changed the title Underscore private function name in router Don't import private function name from router Sep 10, 2024
Copy link
Contributor

@odarriba odarriba left a comment

Choose a reason for hiding this comment

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

Added a comment of a required change to be able to call the parse_options function which is no longer imported

lib/error_tracker/web/router.ex Outdated Show resolved Hide resolved
@crbelaus crbelaus merged commit ac839f5 into main Sep 11, 2024
3 checks passed
@crbelaus crbelaus deleted the dont-import-private-function-in-router branch September 11, 2024 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Router conflict with PhoenixAnalytics
2 participants