Skip to content

Commit

Permalink
configure action to use custom properties file
Browse files Browse the repository at this point in the history
  • Loading branch information
dbelyaev committed Sep 15, 2023
1 parent 59030aa commit 4b9e9cd
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/checkstyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ jobs:
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
checkstyle_config: ./properties_file/test_checks.xml
properties_file: ./properties_file/additional.properties
1 change: 1 addition & 0 deletions properties_file/additional.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
max-line-length=50
15 changes: 15 additions & 0 deletions properties_file/test_checks.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">

<module name="Checker">
<property name="charset" value="UTF-8"/>
<property name="severity" value="warning"/>
<property name="fileExtensions" value="java, properties, xml"/>

<module name="LineLength">
<property name="fileExtensions" value="java"/>
<property name="max" value="${max-line-length}"/><!-- value from additional property defined in a separate property file, should be resolved -->
</module>
</module>
45 changes: 45 additions & 0 deletions src/main/Application.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import java.util.Arrays;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class Application {

public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}

private void DoReallyNothing() {
try {
var counter = 100;

} catch (Exception e) {

}
}

/**
* some java doc.
*
* @param ctx application contexxt
* @return some return
*/
@Bean
public CommandLineRunner commandLineRunner(ApplicationContext ctx) {
return args -> {
System.out.println("Let's inspect the beans provided by Spring Boot:");

var LongString = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Porta lorem";

String[] beanNames = ctx.getBeanDefinitionNames();
Arrays.sort(beanNames);
for (String beanName : beanNames) {
System.out.println(beanName);
}
};
}

}

0 comments on commit 4b9e9cd

Please sign in to comment.