-
Notifications
You must be signed in to change notification settings - Fork 36
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
extract alias usage #135
Merged
Merged
extract alias usage #135
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
novaugust
force-pushed
the
me/alias-usage
branch
from
March 11, 2024 19:41
3a4e85d
to
7159e04
Compare
novaugust
commented
Mar 12, 2024
novaugust
commented
Mar 12, 2024
novaugust
force-pushed
the
me/alias-usage
branch
4 times, most recently
from
March 15, 2024 03:18
f5f960c
to
752b19d
Compare
novaugust
force-pushed
the
me/alias-usage
branch
from
March 15, 2024 03:21
752b19d
to
d50f93e
Compare
novaugust
force-pushed
the
me/alias-usage
branch
from
March 15, 2024 03:27
d50f93e
to
8ce2388
Compare
novaugust
commented
Mar 15, 2024
novaugust
commented
Mar 15, 2024
lib/style/module_directives.ex
Outdated
Stream String StringIO Supervisor System Task Time | ||
Tuple URI Version)a) | ||
|
||
@libraries MapSet.new(~w(Ecto Plug Phoenix Oban)a) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
going to have to make this configurable probably 🤔
novaugust
commented
Mar 15, 2024
@@ -0,0 +1,110 @@ | |||
# Copyright 2023 Adobe. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
welcome to 2024!
novaugust
force-pushed
the
me/alias-usage
branch
from
March 16, 2024 20:36
9b526c0
to
2f51e7d
Compare
novaugust
force-pushed
the
me/alias-usage
branch
from
March 16, 2024 20:39
2f51e7d
to
27e7030
Compare
novaugust
force-pushed
the
me/alias-usage
branch
from
March 16, 2024 20:54
2f85ab8
to
3c6ed0a
Compare
novaugust
force-pushed
the
me/alias-usage
branch
from
March 17, 2024 00:28
fcb3f19
to
1326477
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Write a Styler style that does the work of
Credo.Check.Design.AliasUsage
, lifting deeply nested aliases byalias
ing them.Notably, even if you're running credo's AliasUsage, styler will fix a lot more things.
This is because styler is fixing things that credo ignores:
@module_attribute A.B.C.f()
due to a mistaken report that dialyzer can't understand aliasesapply(A.B.C, :f, [])
doesn't set credo off. (credo does complain if the module is the only argument to a function call)Yes, I thought of at least some of the cases where it shouldn't do that and implemented safeguards :)
🚢
pretty sure this really will need configuration options to add more excluded namespaces than the stdlib (Plug for instance), but i'm merging to main as is and will do that as its own followup since it touches Styler itself
styler: [alias_lifting_exclude: [Plug, GetText, ...]]
quote
blocks)quote
blocks ?