While testing some other spotless changes, I noticed this interesting behaviour. ForbidWildcardImports fails to flag wildcard import statements that have leading whitespace (either indentation or tab). Leading whitespace before an import is valid Java (although ugly 😅), so these lines compile but they don't get detected by the lint.
Steps to reproduce
Run the forbidWildcardImports step against:
(2 leading spaces)
Expected
Line reported as wildcard-import lint errors.
Actual
No lint error.
While testing some other spotless changes, I noticed this interesting behaviour. ForbidWildcardImports fails to flag wildcard import statements that have leading whitespace (either indentation or tab). Leading whitespace before an
importis valid Java (although ugly 😅), so these lines compile but they don't get detected by the lint.Steps to reproduce
Run the
forbidWildcardImportsstep against:(2 leading spaces)
Expected
Line reported as wildcard-import lint errors.
Actual
No lint error.