Navigation Menu

Skip to content

Commit

Permalink
Apply check style and modify .travis.yml to support this new project …
Browse files Browse the repository at this point in the history
…configuration
  • Loading branch information
pedrovgs committed Nov 30, 2014
1 parent fffcf9c commit 9669c5b
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -10,4 +10,4 @@ android:
- extra-android-support

script:
./gradlew build
./gradlew checkstyle build
Expand Up @@ -21,14 +21,13 @@
import dagger.Provides;

/**
* Dagger module created to provide some common activity scope depdendencies as @ActivityContext. This
* module is going to be added to the graph generated for every activity while the activity creation
* lifecycle.
* Dagger module created to provide some common activity scope depdendencies as @ActivityContext.
* This module is going to be added to the graph generated for every activity while the activity
* creation lifecycle.
*
* @author Pedro Vicente Gómez Sánchez
*/
@Module(library = true)
public final class ActivityModule {
@Module(library = true) public final class ActivityModule {

private final Activity activity;

Expand Down
Expand Up @@ -56,7 +56,8 @@ class GetTvShowsInteractor implements Interactor, GetTvShows {
@Override public void execute(final Callback callback) {
if (callback == null) {
throw new IllegalArgumentException(
"Callback can't be null, the client of this interactor needs to get the response in the callback");
"Callback can't be null, the client of this interactor needs to get the response "
+ "in the callback");
}
this.callback = callback;
this.executor.run(this);
Expand Down
Expand Up @@ -21,7 +21,7 @@
import java.util.Set;

/**
* Contains all the available TvShows for this sample. All this harcoded data simulates some
* Contains all the available TvShows for this sample. All this hard coded data simulates some
* information obtained from an external service.
*
* @author Pedro Vicente Gómez Sánchez
Expand Down Expand Up @@ -393,7 +393,6 @@ public Collection<TvShow> getTvShows() {
*
* @param tvShowId used to search inside the catalog.
* @return a TvShow that matches with the parameter passed as identifier.
* @throws TvShowNotFoundException if there is no TvShow associated to the id passed as
* parameter.
*/
public TvShow getTvShowById(String tvShowId) throws TvShowNotFoundException {
Expand Down
Expand Up @@ -43,8 +43,7 @@
injects = {
MainActivity.class, TvShowCatalogFragment.class, TvShowDraggableFragment.class,
TvShowFragment.class, TvShowActivity.class
})
public final class TvShowUIModule {
}) public final class TvShowUIModule {

@Provides TvShowRendererBuilder provideTvShowRendererBuilder(TvShowRenderer tvShowRenderer) {
LinkedList<Renderer<TvShow>> renderers = new LinkedList<Renderer<TvShow>>();
Expand Down
Expand Up @@ -40,8 +40,7 @@ public class ChapterRenderer extends Renderer<Chapter> {
@InjectView(R.id.tv_chapter_title) TextView tv_chapter_title;
@InjectView(R.id.tv_chapter_publish_date) TextView tv_chapter_publish_date;

@Inject
public ChapterRenderer() {
@Inject public ChapterRenderer() {
}

private int position;
Expand All @@ -50,23 +49,19 @@ public void setPosition(int position) {
this.position = position;
}

@Override
protected void setUpView(View view) {
@Override protected void setUpView(View view) {
ButterKnife.inject(this, view);
}

@Override
protected void hookListeners(View view) {
@Override protected void hookListeners(View view) {
//Empty because we are using ButterKnife to inject views.
}

@Override
protected View inflate(LayoutInflater layoutInflater, ViewGroup viewGroup) {
@Override protected View inflate(LayoutInflater layoutInflater, ViewGroup viewGroup) {
return layoutInflater.inflate(R.layout.row_chapter, viewGroup, false);
}

@Override
public void render() {
@Override public void render() {
Chapter chapter = getContent();
renderChapterNumber();
renderChapterTitle(chapter);
Expand Down
14 changes: 6 additions & 8 deletions config/checkstyle/checkstyle.xml
Expand Up @@ -3,6 +3,11 @@
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">


<!-- THIS CHECKSYTLE CONFIGURATION IS SIMILAR TO THE ONE USED BY SQUARE INC. IF YOU WANT TO
CONFIGURE YOUR IDE TO USE THIS CHECKSTYLE TAKE A LOOK AT https://github.com/square/java-code-styles-->


<module name="Checker">
<!--module name="NewlineAtEndOfFile"/-->
<module name="FileLength"/>
Expand Down Expand Up @@ -39,9 +44,6 @@
<!-- Checks for Naming Conventions. -->
<!-- See http://checkstyle.sf.net/config_naming.html -->

<module name="LocalFinalVariableName"/>
<module name="LocalVariableName"/>
<module name="MemberName"/>
<module name="MethodName"/>
<module name="PackageName"/>
<module name="ParameterName"/>
Expand All @@ -61,10 +63,7 @@
<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<module name="LineLength">
<property name="max" value="100"/>
</module>
<module name="MethodLength">
<property name="max" value="200"/>
<property name="max" value="120"/>
</module>

<!--module name="ParameterNumber"/-->
Expand Down Expand Up @@ -111,7 +110,6 @@
<!--<module name="InnerAssignment"/>-->
<!--module name="MagicNumber"/-->
<module name="MissingSwitchDefault"/>
<module name="RedundantThrows"/>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>

Expand Down

0 comments on commit 9669c5b

Please sign in to comment.