Skip to content

Commit 9669c5b

Browse files
committed
Apply check style and modify .travis.yml to support this new project configuration
1 parent fffcf9c commit 9669c5b

File tree

7 files changed

+20
-29
lines changed

7 files changed

+20
-29
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ android:
1010
- extra-android-support
1111

1212
script:
13-
./gradlew build
13+
./gradlew checkstyle build

app/src/main/java/com/github/pedrovgs/effectiveandroidui/di/ActivityModule.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,13 @@
2121
import dagger.Provides;
2222

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

3332
private final Activity activity;
3433

app/src/main/java/com/github/pedrovgs/effectiveandroidui/domain/GetTvShowsInteractor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ class GetTvShowsInteractor implements Interactor, GetTvShows {
5656
@Override public void execute(final Callback callback) {
5757
if (callback == null) {
5858
throw new IllegalArgumentException(
59-
"Callback can't be null, the client of this interactor needs to get the response in the callback");
59+
"Callback can't be null, the client of this interactor needs to get the response "
60+
+ "in the callback");
6061
}
6162
this.callback = callback;
6263
this.executor.run(this);

app/src/main/java/com/github/pedrovgs/effectiveandroidui/domain/tvshow/Catalog.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import java.util.Set;
2222

2323
/**
24-
* Contains all the available TvShows for this sample. All this harcoded data simulates some
24+
* Contains all the available TvShows for this sample. All this hard coded data simulates some
2525
* information obtained from an external service.
2626
*
2727
* @author Pedro Vicente Gómez Sánchez
@@ -393,7 +393,6 @@ public Collection<TvShow> getTvShows() {
393393
*
394394
* @param tvShowId used to search inside the catalog.
395395
* @return a TvShow that matches with the parameter passed as identifier.
396-
* @throws TvShowNotFoundException if there is no TvShow associated to the id passed as
397396
* parameter.
398397
*/
399398
public TvShow getTvShowById(String tvShowId) throws TvShowNotFoundException {

app/src/main/java/com/github/pedrovgs/effectiveandroidui/ui/presenter/TvShowUIModule.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@
4343
injects = {
4444
MainActivity.class, TvShowCatalogFragment.class, TvShowDraggableFragment.class,
4545
TvShowFragment.class, TvShowActivity.class
46-
})
47-
public final class TvShowUIModule {
46+
}) public final class TvShowUIModule {
4847

4948
@Provides TvShowRendererBuilder provideTvShowRendererBuilder(TvShowRenderer tvShowRenderer) {
5049
LinkedList<Renderer<TvShow>> renderers = new LinkedList<Renderer<TvShow>>();

app/src/main/java/com/github/pedrovgs/effectiveandroidui/ui/renderer/chapter/ChapterRenderer.java

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ public class ChapterRenderer extends Renderer<Chapter> {
4040
@InjectView(R.id.tv_chapter_title) TextView tv_chapter_title;
4141
@InjectView(R.id.tv_chapter_publish_date) TextView tv_chapter_publish_date;
4242

43-
@Inject
44-
public ChapterRenderer() {
43+
@Inject public ChapterRenderer() {
4544
}
4645

4746
private int position;
@@ -50,23 +49,19 @@ public void setPosition(int position) {
5049
this.position = position;
5150
}
5251

53-
@Override
54-
protected void setUpView(View view) {
52+
@Override protected void setUpView(View view) {
5553
ButterKnife.inject(this, view);
5654
}
5755

58-
@Override
59-
protected void hookListeners(View view) {
56+
@Override protected void hookListeners(View view) {
6057
//Empty because we are using ButterKnife to inject views.
6158
}
6259

63-
@Override
64-
protected View inflate(LayoutInflater layoutInflater, ViewGroup viewGroup) {
60+
@Override protected View inflate(LayoutInflater layoutInflater, ViewGroup viewGroup) {
6561
return layoutInflater.inflate(R.layout.row_chapter, viewGroup, false);
6662
}
6763

68-
@Override
69-
public void render() {
64+
@Override public void render() {
7065
Chapter chapter = getContent();
7166
renderChapterNumber();
7267
renderChapterTitle(chapter);

config/checkstyle/checkstyle.xml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
44
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
55

6+
7+
<!-- THIS CHECKSYTLE CONFIGURATION IS SIMILAR TO THE ONE USED BY SQUARE INC. IF YOU WANT TO
8+
CONFIGURE YOUR IDE TO USE THIS CHECKSTYLE TAKE A LOOK AT https://github.com/square/java-code-styles-->
9+
10+
611
<module name="Checker">
712
<!--module name="NewlineAtEndOfFile"/-->
813
<module name="FileLength"/>
@@ -39,9 +44,6 @@
3944
<!-- Checks for Naming Conventions. -->
4045
<!-- See http://checkstyle.sf.net/config_naming.html -->
4146

42-
<module name="LocalFinalVariableName"/>
43-
<module name="LocalVariableName"/>
44-
<module name="MemberName"/>
4547
<module name="MethodName"/>
4648
<module name="PackageName"/>
4749
<module name="ParameterName"/>
@@ -61,10 +63,7 @@
6163
<!-- Checks for Size Violations. -->
6264
<!-- See http://checkstyle.sf.net/config_sizes.html -->
6365
<module name="LineLength">
64-
<property name="max" value="100"/>
65-
</module>
66-
<module name="MethodLength">
67-
<property name="max" value="200"/>
66+
<property name="max" value="120"/>
6867
</module>
6968

7069
<!--module name="ParameterNumber"/-->
@@ -111,7 +110,6 @@
111110
<!--<module name="InnerAssignment"/>-->
112111
<!--module name="MagicNumber"/-->
113112
<module name="MissingSwitchDefault"/>
114-
<module name="RedundantThrows"/>
115113
<module name="SimplifyBooleanExpression"/>
116114
<module name="SimplifyBooleanReturn"/>
117115

0 commit comments

Comments
 (0)