-
Notifications
You must be signed in to change notification settings - Fork 2k
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] CS-Rule: No external library in public API #4624
Conversation
…heck for public class for external Dependency check
…into CS-Rule-ExternalDependency
…into CS-Rule-ExternalDependency
...-reports/src/main/java/com/azure/tools/checkstyle/checks/ExternalDependencyExposedCheck.java
Show resolved
Hide resolved
Does this check handle a scenario such as |
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.
minor things , open to talk about it 👍
...-reports/src/main/java/com/azure/tools/checkstyle/checks/ExternalDependencyExposedCheck.java
Outdated
Show resolved
Hide resolved
...-reports/src/main/java/com/azure/tools/checkstyle/checks/ExternalDependencyExposedCheck.java
Outdated
Show resolved
Hide resolved
eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml
Outdated
Show resolved
Hide resolved
…into CS-Rule-ExternalDependency
...-reports/src/main/java/com/azure/tools/checkstyle/checks/ExternalDependencyExposedCheck.java
Outdated
Show resolved
Hide resolved
Alan's point here is a good one. For example, ConfigurationClientCredentials has methods that take 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.
Looks good to me, after taking into account the feedback from the other reviewers.
…into CS-Rule-ExternalDependency
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.
Looking great!
Refactored the code and created a recursion method that takes care of (1) TYPE as a root node, it can have IDENT and/or TYPE_AURGUMENTS as children nodes; (2) TYPE_AURGUMENT as a root node, it can have IDENT and/or TYPE_AURGUMENTS as children nodes; (3) TYPE_AURGUMENTS as a root node, it can have TYPE_AURGUMENT as child node. |
A fix to No External Dependency check style rule. Previously, it fails only on the method's return type but not parameter types, and not checking on a protected class.
Also, remove unused import