inaka

Latest blog entries

/
The Art of Writing a Blogpost

The Art of Writing a Blogpost

Mar 09 2017 : Matias Vera

/
SpellingCI: No more spelling mistakes in your markdown flies!

Feb 14 2017 : Felipe Ripoll

/
Fast reverse geocoding with offline-geocoder

Do you need a blazing fast reverse geocoder? Enter offline-geocoder!

Jan 18 2017 : Roberto Romero

/
Using Jayme to connect to the new MongooseIM REST services

MongooseIM has RESTful services!! Here I show how you can use them in an iOS application.

Dec 13 2016 : Sergio Abraham

/
20 Questions, or Maybe a Few More

20 Questions, or Maybe a Few More

Nov 16 2016 : Stephanie Goldner

/
The Power of Meeting People

Because conferences and meetups are not just about the technical stuff.

Nov 01 2016 : Pablo Villar

/
Finding the right partner for your app build

Sharing some light on how it is to partner with us.

Oct 27 2016 : Inaka

/
Just Play my Sound

How to easily play a sound in Android

Oct 25 2016 : Giaquinta Emiliano

/
Opening our Guidelines to the World

We're publishing our work guidelines for the world to see.

Oct 13 2016 : Brujo Benavides

/
Using NIFs: the easy way

Using niffy to simplify working with NIFs on Erlang

Oct 05 2016 : Hernan Rivas Acosta

/
Function Naming In Swift 3

How to write clear function signatures, yet expressive, while following Swift 3 API design guidelines.

Sep 16 2016 : Pablo Villar

/
Jenkins automated tests for Rails

How to automatically trigger rails tests with a Jenkins job

Sep 14 2016 : Demian Sciessere

/
Erlang REST Server Stack

A description of our usual stack for building REST servers in Erlang

Sep 06 2016 : Brujo Benavides

/
Replacing JSON when talking to Erlang

Using Erlang's External Term Format

Aug 17 2016 : Hernan Rivas Acosta

/
Gadget + Lewis = Android Lint CI

Integrating our Android linter with Github's pull requests

Aug 04 2016 : Fernando Ramirez and Euen Lopez

/
Passwordless login with phoenix

Introducing how to implement passwordless login with phoenix framework

Jul 27 2016 : Thiago Borges

/
Beam Olympics

Our newest game to test your Beam Skills

Jul 14 2016 : Brujo Benavides

/
Otec

Three Open Source Projects, one App

Jun 28 2016 : Andrés Gerace

/
CredoCI

Running credo checks for elixir code on your github pull requests

Jun 16 2016 : Alejandro Mataloni

/
Thoughts on rebar3

Thoughts on rebar3

Jun 08 2016 : Hernán Rivas Acosta

/
See all Inaka's blog posts >>

/
Presenting Lewis, our own Android Lint extension

Fernando Ramirez wrote this on February 15, 2016 under android, dev, gradle, inaka, language, lint, programming, tool .

Introduction

The Android Lint tool is a static code analysis tool that checks your Android project source files for potential bugs and optimization improvements for correctness, security, performance, usability, accessibility, and internationalization.

Along different Android projects we have detected some common 'mistakes'. Because of that reason, we have made our Android guidelines. We found out that there were several of those conventions that we could check extending Lint tool. So, Lewis was the result.

In other words, Lewis is an extension of Android Lint, adding our own new rules.

New rules in Lewis

  • Every .java file must be inside a custom package, not inside the root package.
  • Every application must have at least one launcher activity.
  • Every application must have only one launcher activity.
  • A library must not have a launcher activity.
  • A library must not have icons.
  • A library must not use permissions.
  • Every instance variable must be named beginning with 'm' and using camelCase.
  • Every class constant (static and final) must be named using UPPER_SNAKE_CASE.

Inside the Lewis repository you can read more details about those items.

Getting started

These are the steps you have to follow to start using Lewis:

1. Clone the repository

git clone https://github.com/inaka/lewis.git

2. Enter to the project

cd lewis/

3. Build it

./gradlew build

4. Install it

./gradlew install

5. Verify issues

lint --show RootPackage

Note If you can't run lint directly:

PATH=$PATH:~/Library/Android/sdk/tools
source ~/.bash_profile.

6. Run lint

Go to any Android project and run:

./gradlew lint

Or inside Android Studio select Analyze menu, Inspect Code option.

How to disable an issue

Add on your build.gradle file:

android {
    lintOptions {
        disable 'RootPackage','IconInLibrary'
        ...
    }
}

Resources

Support

For questions or general comments regarding the use of this tool, please use our public hipchat room.

If you find any bugs, have any problem or ideas of possible new rules that must be added to Lewis, please open an issue (or send a pull request with your solution).

You can check all of our open-source projects at inaka.github.io.