Skip to content

Commit

Permalink
Update diktat-analysis configs and migrate to log4j2 (#1156)
Browse files Browse the repository at this point in the history
### What's done:
* Update diktat-analysis configs and migrate to log4j2
  • Loading branch information
kgevorkyan authored Dec 23, 2021
1 parent da3f5ae commit e8007b5
Show file tree
Hide file tree
Showing 16 changed files with 62 additions and 33 deletions.
10 changes: 8 additions & 2 deletions diktat-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,14 @@
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.17.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>2.17.0</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down
6 changes: 0 additions & 6 deletions diktat-common/src/main/resources/log4j.properties

This file was deleted.

8 changes: 8 additions & 0 deletions diktat-common/src/main/resources/log4j2.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
rootLogger.level = info
rootLogger.appenderRef.stdout.ref = STDOUT

appender.stdout.type = Console
appender.stdout.name = STDOUT
appender.stdout.target = SYSTEM_OUT
appender.stdout.layout.type = PatternLayout
appender.stdout.layout.pattern = [%-5p] %d{yyyy-MM-dd HH:mm:ss} %m%n
10 changes: 8 additions & 2 deletions diktat-rules/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,14 @@
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.17.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>2.17.0</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down
2 changes: 1 addition & 1 deletion diktat-rules/src/main/resources/diktat-analysis-huawei.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
enabled: true
configuration:
isCopyrightMandatory: true
copyrightText: ' Copyright (c) Huawei Technologies Co., Ltd. 2012-2021. All rights reserved.'
copyrightText: ' Copyright (c) Huawei Technologies Co., Ltd. 2012-;@currYear;. All rights reserved.'
# Checks that header kdoc is located before package directive
- name: HEADER_NOT_BEFORE_PACKAGE
enabled: true
Expand Down
2 changes: 1 addition & 1 deletion diktat-rules/src/main/resources/diktat-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
enabled: true
configuration:
isCopyrightMandatory: false
copyrightText: 'Copyright (c) Your Company Name Here. 2010-2021'
copyrightText: 'Copyright (c) Your Company Name Here. 2010-;@currYear;'
# Checks that header kdoc is located before package directive
- name: HEADER_NOT_BEFORE_PACKAGE
enabled: true
Expand Down
6 changes: 0 additions & 6 deletions diktat-rules/src/main/resources/log4j.properties

This file was deleted.

8 changes: 8 additions & 0 deletions diktat-rules/src/main/resources/log4j2.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
rootLogger.level = info
rootLogger.appenderRef.stdout.ref = STDOUT

appender.stdout.type = Console
appender.stdout.name = STDOUT
appender.stdout.target = SYSTEM_OUT
appender.stdout.layout.type = PatternLayout
appender.stdout.layout.pattern = [%-5p] %d{yyyy-MM-dd HH:mm:ss} %m%n
10 changes: 8 additions & 2 deletions diktat-test-framework/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,14 @@
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.17.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>2.17.0</version>
</dependency>
<dependency>
<groupId>io.github.petertrr</groupId>
Expand Down
6 changes: 0 additions & 6 deletions diktat-test-framework/src/main/resources/log4j.properties

This file was deleted.

8 changes: 8 additions & 0 deletions diktat-test-framework/src/main/resources/log4j2.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
rootLogger.level = info
rootLogger.appenderRef.stdout.ref = STDOUT

appender.stdout.type = Console
appender.stdout.name = STDOUT
appender.stdout.target = SYSTEM_OUT
appender.stdout.layout.type = PatternLayout
appender.stdout.layout.pattern = [%-5p] %d{yyyy-MM-dd HH:mm:ss} %m%n
2 changes: 1 addition & 1 deletion examples/gradle-groovy-dsl/diktat-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
enabled: true
configuration:
isCopyrightMandatory: false
copyrightText: 'Copyright (c) Your Company Name Here. 2010-2021'
copyrightText: 'Copyright (c) Your Company Name Here. 2010-;@currYear;'
# Checks that header kdoc is located before package directive
- name: HEADER_NOT_BEFORE_PACKAGE
enabled: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
enabled: true
configuration:
isCopyrightMandatory: true
copyrightText: 'Copyright (c) Your Company Name Here. 2010-2021'
copyrightText: 'Copyright (c) Your Company Name Here. 2010-;@currYear;'
- name: HEADER_NOT_BEFORE_PACKAGE
enabled: true
- name: FILE_IS_TOO_LONG
Expand Down
2 changes: 1 addition & 1 deletion examples/gradle-kotlin-dsl/diktat-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
enabled: true
configuration:
isCopyrightMandatory: false
copyrightText: 'Copyright (c) Your Company Name Here. 2010-2021'
copyrightText: 'Copyright (c) Your Company Name Here. 2010-;@currYear;'
# Checks that header kdoc is located before package directive
- name: HEADER_NOT_BEFORE_PACKAGE
enabled: true
Expand Down
2 changes: 1 addition & 1 deletion examples/maven/diktat-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
enabled: true
configuration:
isCopyrightMandatory: false
copyrightText: 'Copyright (c) Your Company Name Here. 2010-2021'
copyrightText: 'Copyright (c) Your Company Name Here. 2010-;@currYear;'
# Checks that header kdoc is located before package directive
- name: HEADER_NOT_BEFORE_PACKAGE
enabled: true
Expand Down
11 changes: 8 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,14 @@
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.17.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>2.17.0</version>
</dependency>
<dependency>
<groupId>io.github.petertrr</groupId>
Expand Down

0 comments on commit e8007b5

Please sign in to comment.