Closed greenlaw110 closed 2 weeks ago
Tnx for suggestion. It will not be implemented though.
Ktlint focusses primarily on rearranging code to make it more consistent and readible. Restricting which packages may, or may not be used, is not a function that fits in the scope of the project.
You can develop a custom ktlint rule yourself. See https://pinterest.github.io/ktlint/latest/api/custom-rule-set/ for a starting point.
Restrict import package, e.g.
org.joda
,org.junit
etc.Expected Rule behavior
When user specified a package to be restricted, e.g.
org.joda
, and if any kt source code hasimport org.joda.<AnyClass>
then the rule should fail the check.Additional information