1

In Android studio, If we write a log tag of more than 23 characters, it shows an underlined warning saying tag can't be more than 23 characters (pic for ref).

enter image description here

If we want to do something similar to our own method (maybe while writing a new library), How can we achieve that?

Marcin Orlowski
  • 72,056
  • 11
  • 123
  • 141
Sandesh Baliga
  • 579
  • 5
  • 20

1 Answers1

1

If you want checks not covered by current release of lint, then you need to to write own rules. There's sample repo on github with sample custom rules: https://github.com/googlesamples/android-custom-lint-rules

Marcin Orlowski
  • 72,056
  • 11
  • 123
  • 141
  • Awesome, exactly what I wanted. Thanks mate. And also, In this case, I cant actually distribute my custom link rules along with the library I package right? Any way I can make my lint rules reach the users of my library? – Sandesh Baliga May 17 '19 at 10:12
  • sure you can have your rules distributable as jar. You may need to search a bit on that but first randomly found tutorial on custom list rules seem to cover that too: https://www.bignerdranch.com/blog/building-custom-lint-checks-in-android/ – Marcin Orlowski May 17 '19 at 10:39