From 9b1b797d09159fe7e3d0ee9d33047f1d863e1f43 Mon Sep 17 00:00:00 2001 From: Carlos Rafael Giani Date: Mon, 13 Dec 2021 17:21:30 +0100 Subject: [PATCH] IDEA/Android Studio: Disallow wildcard imports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wildcard imports are generally discouraged for these reasons: (Source: https://jiga.dev/avoiding-wildcard-imports-in-java-kotlin-with-intellij/) * Explicit imports clearly states what external classes the current class is directly using, provided that you don’t leave redundant imports in your code. * If there are two classes with the same name from different packages, it can introduce collision when using wildcard imports. * When multiple people are working in a project, wildcard imports can create confusion as to which classes are actually imported. Also note that ktlint has a rule against wildcard imports. Signed-off-by: Carlos Rafael Giani --- .idea/codeStyles/Project.xml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index a9c3d0e4d9..c76f23799b 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -3,9 +3,12 @@