Skip to content

ErickSumargo/Cross

Repository files navigation

Build Status codecov

So I've written out my personal compilation code review set in:
https://proandroiddev.com/personal-request-changes-materials-starter-pack-kotlin-ver-part-1-9a938f3768ad, https://proandroiddev.com/personal-request-changes-materials-starter-pack-kotlin-ver-part-2-426084b9c9a1.

Those docs really save me instead of re-explaining every time similar issues pop in code review activity. But still, re-introducing them to every new reviewee is kinda inevitably.

So I wonder if only I can have, let's say a bot to represent this boring task. Well, actually there is. What I only need is to create custom lints and leverage com.android.tools.lint APIs to make it happen. Below are the PoCs.

Proof of Concept (PoC)

A recap (not all should be implemented tho):

1. No Meaningless Nullable Primitives

Implementation
UT
Result

2. Kotlin’s Named Arguments

Implementation
UT
Result

4. Max. 1 Nested Condition Block Tolerance

Implementation
UT
Result

5. Destructuring Declarations? Not even once

Implementation
UT
Result

6. It's XUtils

Implementation
UT
Result

7. Public Methods as API Contracts

Implementation
UT
Result

9. Constructors Should Be Code-Free

Implementation
UT
Result

10. A Class is Either Final or Abstract

Implementation
UT
Result

11. The Temporal Coupling

Implementation
UT
Result

Screenshot

Including real-time inspection 🤩

⚠️ Disclaimer ⚠️

This project should only be used for research purpose. Plug those lints into your codebase is discouraged unless you do really understand why and how they react to corresponding issue.

License

MIT License

Copyright (c) 2020 ErickSumargo

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.