Coder Social home page Coder Social logo

android-linters's Introduction

Build Status Coverage Status Download

Android Linters

Android Linters is a project which contains custom linters for an Android project.

Why use it?

This project allows you to prevent some runtime errors. For example, if you forgot to write a variable in your Parcelable class the linter will tell you what variable you forgot to write.

Linters

ParcelDetector

Check for malformed Parcelable implementations:

  • You forgot to write a variable
  • You forgot to read a variable
  • You forgot to call super in your constructor or in writeToParcel method
  • You read a different type than you wrote
  • You write in a different order than you read

For each case, the linter will show in which line is the error and what is the reason.

FactoryMethodDetector

Checks that any instantion of a fragment is done in a factory method to prevent forgetting the necessary arguments

InstanceStateDetector

Makes sure instance state is properly saved and restored.

  • You forgot to save a variable in your onSaveInstanceState method
  • You forgot to restore a variable
  • You overwrite a saved variable
  • You overwrite a restored variable
  • Save and restore different types

ManifestDetector

It is a xml detector that checks if you request for duplicate permissions in you AndroidManifest.xml

Usage

In the project there is a script that download the jar with all the linters and it will copy to your directory $HOME/.android/lint/

Copyright and License

Copyright 2010-2015 Monits.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License at:

http://www.apache.org/licenses/LICENSE-2.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.