Skip to content

Lint - Remove Tag Soup Library and Html To Spanned Converter #15882

@ParaskP7

Description

@ParaskP7

TL;DR

As part of fixing new Lint warnings, due to upgrading to AGP 7.0.4, a new Lint Failure warning appeared for the HtmlToSpannedConverter class.

I tried to suppress this Lint error by adding the @SuppressLint("LintError") annotation (see commit), but it didn't work and CI kept complaining.

Also, running Lint locally doesn't always produce this Lint Failure. However, on CI is always does. This means that this Lint error is not deterministic in general and needs to be resolved sooner than later.

Details

When reading through the Lint Failure message you will notice the below:

This does not work correctly when running in AGP (7.0.4).

In particular, there may be false positives or false negatives because
the lint check may be using the minSdkVersion or manifest information
from the library instead of any consuming app module.

After I investigated this issue in more detail it seems that the org.ccil.cowan.tagsoup:tagsoup:1.2.1 library is what causing it. I then tried to understand how dependant our codebase is to this library and the HtmlToSpannedConverter class for that matter. What I found was encouraging as the only real usage lies within the UnifiedCommentViewHolder:29 line. This line was added relatively recently (15/6/21) by @khaykov . This means that if we can replace this line with another solution, then our codebase will be free from the out-dated Tag Soup library (Aug 22, 2011) and HtmlToSpannedConverter class (3/3/17). Then, a removal of all code related to that could look like this temporary commit.

Assignment

I am assigning this to me and you @khaykov because I want us to look into that together and figure out if we could easily migrate away from the Tag Soup library and HtmlToSpannedConverter class. Doing that would also greatly help with the Upgrade Gradle to 7.3.3 & AGP to 7.0.4 work, most probably even unblock it, since I haven't yet found an alternative solution to it (by suppressing it somehow or otherwise).

I am not familiar with UnifiedCommentViewHolder and what it means to have a proper comment.text. Thus, any help would be greatly appreciated.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions