checkstyle / checkstyle/test-configs
Refactoring of existing code, part 1
- Dominant language
- Java
- Stars
- 3
- Forks
- 11
- Avg merge
- 3d 19h
- Merged PRs (30d)
- 2
Description
1.
All code like `LOGGER.warn("Skipping invalid line in projects.properties: " + trimmedLine);` should be `LOGGER.warn("Skipping invalid line in projects.properties: {}", trimmedLine);`
api of logger do concatenation, let use compact mode
2.
`LOGGER.error("Error in application state or arguments: " + ex.getMessage(), ex);` ==> `LOGGER.error("Error in application state or arguments: ", ex);`
no need to print message and exception stackatrace, just print whole excpetion it will print all.
3.
Lets move all methods that do git commands to class GitCommands.java and keep all of them as static to make it clear they are stateless util methods.
4.
```
final boolean isRegressionTesting =
cfg.get("branch") != null && cfg.get("localGitRepo") != null;
```
should be moved to `main()` method and provided to launchCheckstyleReport as argument.
5.
```
if (checkstylePatchReportInfo != null) {
deleteDir(cfg.getReportsDir());
```
should be:
```
if (isRegressionTesting) {
deleteDir(cfg.getReportsDir());
```
6.
lets move parsers from Yml and Properties to their own classes.
7. generateCheckstyleReport and is also candidate for separate class to own all logic.
---------
Please send each item as separate PR to ease review and acceptance
Contributor guide
Research direction
Start by locating the LOGGER calls, main(), Git-related methods, the Yml and Properties parsers, and generateCheckstyleReport mentioned in the issue. Treat each numbered item as a separate change and review the surrounding callers before moving responsibilities. Done means each requested refactoring is isolated in its own PR and preserves the existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, java
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100