Skip to content

Commit c506f59

Browse files
committed
Merge pull request #533 from php-coder
2 parents 3b64271 + e8eba17 commit c506f59

15 files changed

+44
-51
lines changed

.travis.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ language: java
22

33
env:
44
matrix:
5-
- SPRING_PROFILES_ACTIVE=test
5+
#- SPRING_PROFILES_ACTIVE=test
66
- SPRING_PROFILES_ACTIVE=travis
77
global:
88
- secure: "fBav56BzY+A+Vs1g9YSfo1oLDCO1rFrXl49lJkOA5/XpnsKEEs4lI2RcOzz0wiJKXFNgcliiAJWoYMI8Esqz+lkyFWan4ij5Co0UzJcytDuY+2o+jaqwx45DuDYPogABzT+hWjLCxQLLG46gUkChzT8kcvOOn6JxC7Ff8q5MnoM="
@@ -16,6 +16,9 @@ before_script:
1616
npm install -g bootlint;
1717
pip install --user html5validator;
1818
pip install --user robotframework-lint;
19+
if [ "$TRAVIS_PULL_REQUEST" != 'false' ]; then
20+
gem install bundler danger --no-ri --no-rdoc;
21+
fi;
1922
fi
2023

2124
script:

Dangerfile

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
message("Hello, this worked")
2+
3+
# Sometimes it's a README fix, or something like that - which isn't relevant for
4+
# including in a project's CHANGELOG for example
5+
#declared_trivial = github.pr_title.include? "#trivial"
6+
7+
# Make it more obvious that a PR is a work in progress and shouldn't be merged yet
8+
#warn("PR is classed as Work in Progress") if github.pr_title.include? "[WIP]"
9+
10+
# Warn when there is a big PR
11+
#warn("Big PR") if git.lines_of_code > 500
12+
13+
# Don't let testing shortcuts get into master by accident
14+
#fail("fdescribe left in tests") if `grep -r fdescribe specs/ `.length > 1
15+
#fail("fit left in tests") if `grep -r fit specs/ `.length > 1

pom.xml

+13-7
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@
1010

1111
<dependencies>
1212

13-
<dependency>
14-
<groupId>com.github.heneke.thymeleaf</groupId>
15-
<artifactId>thymeleaf-extras-togglz</artifactId>
16-
<version>${thymeleaf.togglz.version}</version>
17-
</dependency>
18-
1913
<dependency>
2014
<groupId>javax.validation</groupId>
2115
<artifactId>validation-api</artifactId>
2216
<version>${javax.validation.version}</version>
2317
</dependency>
2418

19+
<dependency>
20+
<groupId>com.github.heneke.thymeleaf</groupId>
21+
<artifactId>thymeleaf-extras-togglz</artifactId>
22+
<version>${thymeleaf.togglz.version}</version>
23+
</dependency>
24+
2525
<dependency>
2626
<groupId>org.apache.commons</groupId>
2727
<artifactId>commons-lang3</artifactId>
@@ -733,6 +733,7 @@
733733
</executions>
734734
</plugin>
735735

736+
<!--
736737
<plugin>
737738
<groupId>org.apache.maven.plugins</groupId>
738739
<artifactId>maven-failsafe-plugin</artifactId>
@@ -744,8 +745,9 @@
744745
<suiteXmlFile>${basedir}/src/test/config/testng.xml</suiteXmlFile>
745746
</suiteXmlFiles>
746747
</configuration>
747-
<!-- Use default <execution> configuration from spring-boot-starter-parent -->
748748
</plugin>
749+
-->
750+
<!-- Use default <execution> configuration from spring-boot-starter-parent -->
749751

750752
<plugin>
751753
<groupId>org.apache.maven.plugins</groupId>
@@ -931,13 +933,15 @@
931933
<variable>SITE_URL:http://127.0.0.1:8080</variable>
932934
</variables>
933935
</configuration>
936+
<!--
934937
<executions>
935938
<execution>
936939
<goals>
937940
<goal>run</goal>
938941
</goals>
939942
</execution>
940943
</executions>
944+
-->
941945
</plugin>
942946

943947
<plugin>
@@ -960,6 +964,7 @@
960964
</exclude>
961965
</excludes>
962966
</configuration>
967+
<!--
963968
<executions>
964969
<execution>
965970
<id>start-application</id>
@@ -974,6 +979,7 @@
974979
</goals>
975980
</execution>
976981
</executions>
982+
-->
977983
</plugin>
978984

979985
</plugins>

src/main/config/findbugs-filter.xml

-7
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,6 @@
1717
<Class name="~.*\.model\..*" />
1818
<Bug pattern="EI_EXPOSE_REP,EI_EXPOSE_REP2" />
1919
</Match>
20-
<Match>
21-
<!--
22-
It's ok, that we're don't override parent's equals() method.
23-
-->
24-
<Class name="ru.mystamps.web.support.spring.security.CustomUserDetails" />
25-
<Bug pattern="EQ_DOESNT_OVERRIDE_EQUALS" />
26-
</Match>
2720
<Match>
2821
<!--
2922
I don't care about a serialVersionUID field.

src/main/java/ru/mystamps/web/Db.java

-17
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,3 @@
1-
/*
2-
* Copyright (C) 2009-2017 Slava Semushin <[email protected]>
3-
*
4-
* This program is free software; you can redistribute it and/or modify
5-
* it under the terms of the GNU General Public License as published by
6-
* the Free Software Foundation; either version 2 of the License, or
7-
* (at your option) any later version.
8-
*
9-
* This program is distributed in the hope that it will be useful,
10-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12-
* GNU General Public License for more details.
13-
*
14-
* You should have received a copy of the GNU General Public License
15-
* along with this program; if not, write to the Free Software
16-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17-
*/
181
package ru.mystamps.web;
192

203
public final class Db {

src/main/java/ru/mystamps/web/controller/CategoryController.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ public class CategoryController {
6161

6262
@InitBinder("addCategoryForm")
6363
protected void initBinder(WebDataBinder binder) {
64-
// We can't use StringTrimmerEditor here because "only one single registered custom
65-
// editor per property path is supported".
64+
// We can't use StringTrimmerEditor here because "only one single registered custom editor per property path is supported".
6665
ReplaceRepeatingSpacesEditor editor = new ReplaceRepeatingSpacesEditor(true);
6766
binder.registerCustomEditor(String.class, "name", editor);
6867
binder.registerCustomEditor(String.class, "nameRu", editor);

src/main/java/ru/mystamps/web/controller/CountryController.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
*/
1818
package ru.mystamps.web.controller;
1919

20+
import javax.servlet.http.HttpServletResponse;
21+
import javax.validation.Valid;
22+
2023
import java.io.IOException;
2124
import java.util.List;
2225
import java.util.Locale;
2326

24-
import javax.servlet.http.HttpServletResponse;
25-
import javax.validation.Valid;
26-
2727
import org.springframework.http.HttpStatus;
2828
import org.springframework.stereotype.Controller;
2929
import org.springframework.ui.Model;

src/main/java/ru/mystamps/web/dao/impl/JdbcSeriesDao.java

-6
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,6 @@
4242
import ru.mystamps.web.dao.dto.SitemapInfoDto;
4343

4444
// TODO: move stamps related methods to separate interface (#88)
45-
@SuppressWarnings({
46-
"PMD.AvoidDuplicateLiterals",
47-
"PMD.TooManyMethods",
48-
"PMD.TooManyFields",
49-
"PMD.LongVariable"
50-
})
5145
@RequiredArgsConstructor
5246
public class JdbcSeriesDao implements SeriesDao {
5347

src/main/java/ru/mystamps/web/service/CronServiceImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public void sendDailyStatistics() {
7272

7373
report.setAddedSeriesCounter(seriesService.countAddedSince(yesterday));
7474
report.setUpdatedSeriesCounter(seriesService.countUpdatedSince(yesterday));
75-
report.setUpdatedCollectionsCounter(collectionService.countUpdatedSince(yesterday));
75+
//report.setUpdatedCollectionsCounter(collectionService.countUpdatedSince(yesterday));
7676
report.setRegistrationRequestsCounter(usersActivationService.countCreatedSince(yesterday));
7777
report.setRegisteredUsersCounter(userService.countRegisteredSince(yesterday));
7878

src/main/java/ru/mystamps/web/service/SiteServiceImpl.java

-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ public class SiteServiceImpl implements SiteService {
5555
private final SuspiciousActivityDao suspiciousActivities;
5656

5757
@Override
58-
@SuppressWarnings("PMD.UseObjectForClearerAPI")
5958
@Async
6059
@Transactional
6160
public void logAboutAbsentPage(
@@ -70,7 +69,6 @@ public void logAboutAbsentPage(
7069
}
7170

7271
@Override
73-
@SuppressWarnings("PMD.UseObjectForClearerAPI")
7472
@Transactional
7573
public void logAboutFailedAuthentication(
7674
String page,

src/main/java/ru/mystamps/web/service/UserServiceImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public void registerUser(ActivateAccountDto dto) {
8585

8686
AddUserDbDto user = new AddUserDbDto();
8787
user.setLogin(login);
88-
user.setRole(USER);
88+
//user.setRole(USER);
8989
user.setName(finalName);
9090
user.setEmail(email);
9191
user.setRegisteredAt(registrationDate);

src/main/scripts/ci/check-build-and-verify.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ if [ "$RUN_ONLY_INTEGRATION_TESTS" = 'no' ]; then
3232
mvn --batch-mode sortpom:verify -Dsort.verifyFail=stop >pom.log || POM_FAIL=yes
3333
find src -type f -name '*.html' | xargs bootlint >bootlint.log 2>&1 || BOOTLINT_FAIL=yes
3434
rflint --ignore TooFewKeywordSteps \
35-
--configure LineTooLong:110 \
3635
src/test/robotframework \
3736
>rflint.log 2>&1 || RFLINT_FAIL=yes
3837
mvn --batch-mode jasmine:test >jasmine.log 2>&1 || JASMINE_FAIL=yes
@@ -98,6 +97,10 @@ print_log verify.log 'Run integration tests'
9897

9998
rm -f cs.log pmd.log codenarc.log license.log bootlint.log rflint.log jasmine.log validator.log test.log findbugs.log verify.log
10099

100+
if [ "$SPRING_PROFILES_ACTIVE" = 'travis' -a "${TRAVIS_PULL_REQUEST:-}" != 'false' ]; then
101+
danger
102+
fi
103+
101104
if [ -n "$CS_FAIL$PMD_FAIL$CODENARC_FAIL$LICENSE_FAIL$POM_FAIL$BOOTLINT_FAIL$RFLINT_FAIL$JASMINE_FAIL$HTML_FAIL$TEST_FAIL$FINDBUGS_FAIL$VERIFY_FAIL" ]; then
102105
exit 1
103106
fi

src/test/groovy/ru/mystamps/web/service/CategoryServiceImplTest.groovy

-1
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,6 @@ class CategoryServiceImplTest extends Specification {
452452
thrown IllegalArgumentException
453453
}
454454

455-
@SuppressWarnings(['ClosureAsLastMethodParameter', 'UnnecessaryReturnKeyword'])
456455
def "getStatisticsOf() should pass arguments to dao"() {
457456
given:
458457
Integer expectedCollectionId = 15

src/test/groovy/ru/mystamps/web/service/CollectionServiceImplTest.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class CollectionServiceImplTest extends Specification {
9696
@SuppressWarnings(['ClosureAsLastMethodParameter', 'FactoryMethodName', 'UnnecessaryReturnKeyword'])
9797
def "createCollection() should assign updated at to current date"() {
9898
when:
99-
service.createCollection(123, 'any-login')
99+
service.createCollection(123, "any-login")
100100
then:
101101
1 * collectionDao.add({ AddCollectionDbDto collection ->
102102
assert DateUtils.roughlyEqual(collection?.updatedAt, new Date())

src/test/javascript/CatlogUtilsSpec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe("CatalogUtils.expandNumbers()", function() {
1313
});
1414

1515
it("should return string without hyphen as it", function() {
16-
expect(CatalogUtils.expandNumbers("test")).toEqual("test");
16+
expect(CatalogUtils.expandNumbers("test")).toEqual("2test");
1717
});
1818

1919
it("should return 'one-two' for 'one-two'", function() {

0 commit comments

Comments
 (0)