Merge branch 'master' of https://github.com/AuthMe/AuthMeReloaded into 930-captcha-for-register

This commit is contained in:
ljacqu 2018-01-06 19:04:14 +01:00
commit 9afd8679e9
2 changed files with 45 additions and 31 deletions

View File

@ -1,25 +1,38 @@
engines:
duplication:
enabled: true
config:
languages:
- java
- php
version: '2' # required to adjust maintainability checks
plugins:
checkstyle:
enabled: true
channel: beta
config: '.checkstyle.xml'
pmd:
enabled: true
channel: beta
config:
file: '.checkstyle.xml'
checks:
AvoidUsingHardCodedIP:
# We disable all the following CodeClimate checks: Checkstyle already checks for these things and has the advantage
# that the Checkstyle config can also be used in one's IDE.
argument-count:
enabled: false
ratings:
paths:
# Check only production files
- 'src/main/java/**'
exclude_paths:
complex-logic:
enabled: false
file-lines:
enabled: false
method-complexity:
enabled: false
method-count:
enabled: false
method-lines:
enabled: false
nested-control-flow:
enabled: false
return-statements:
enabled: false
similar-code:
enabled: false
# The "identical-code" check would be cool to enable since Checkstyle offers no such functionality, but it is
# too aggressive and we'd have to suppress many reported warnings.
identical-code:
enabled: false
exclude_patterns:
# Exclude code from third-party sources
- 'src/main/java/fr/xephi/authme/mail/OAuth2Provider.java'
- 'src/main/java/fr/xephi/authme/mail/OAuth2SaslClient.java'
@ -28,4 +41,5 @@ exclude_paths:
- 'src/main/java/fr/xephi/authme/security/crypts/PhpBB.java'
- 'src/main/java/fr/xephi/authme/security/crypts/Whirlpool.java'
- 'src/main/java/fr/xephi/authme/security/crypts/Wordpress.java'
- 'src/test/java/**Test.java'
# Don't check test classes
- 'src/test/java/**/*Test.java'

View File

@ -24,7 +24,7 @@ public class CodeClimateConfigTest {
public void shouldHaveExistingClassesInExclusions() {
// given / when
FileConfiguration configuration = YamlConfiguration.loadConfiguration(new File(CONFIG_FILE));
List<String> excludePaths = configuration.getStringList("exclude_paths");
List<String> excludePaths = configuration.getStringList("exclude_patterns");
// then
assertThat(excludePaths, not(empty()));
@ -49,7 +49,7 @@ public class CodeClimateConfigTest {
}
private static void removeTestsExclusionOrThrow(List<String> excludePaths) {
boolean wasRemoved = excludePaths.removeIf("src/test/java/**Test.java"::equals);
boolean wasRemoved = excludePaths.removeIf("src/test/java/**/*Test.java"::equals);
assertThat("Expected an exclusion for test classes",
wasRemoved, equalTo(true));
}