Skip to content

Commit 3bcaf38

Browse files
authored
project-configuration-improvements
2 parents 4155559 + 0764514 commit 3bcaf38

33 files changed

Lines changed: 1233 additions & 201 deletions

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
indent_style = space
8+
indent_size = 4
9+
10+
[*.java]
11+
indent_size = 4
12+
max_line_length = 120

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
* text=auto
2+
*.java text
3+
*.sh text eol=lf
4+
*.bat text eol=crlf

.github/pull_request_template.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
### Summary
2+
3+
Briefly describe what this PR does and why.
4+
5+
### Details
6+
7+
Add more context about the changes:
8+
9+
- What was changed?
10+
- Why was it changed?
11+
- Any trade-offs or known limitations?
12+
13+
Screenshots, GIFs, or videos are welcome if this affects UI/UX.
14+
15+
### How to Test
16+
17+
Describe how reviewers can test the changes:
18+
19+
1. Step one
20+
2. Step two
21+
3. Expected result
22+
23+
### Checklist
24+
25+
- [ ] Changes have been tested locally
26+
- [ ] Logic is complete at 100%
27+
- [ ] Design/UI is complete at 100%
28+
- [ ] No breaking changes (or they are documented)

.github/workflows/maven.yml

Lines changed: 13 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,24 @@
1-
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
3-
4-
# This workflow uses actions that are not certified by GitHub.
5-
# They are provided by a third-party and are governed by
6-
# separate terms of service, privacy policy, and support
7-
# documentation.
8-
9-
name: Java CI with Maven
1+
name: Java CI
102

113
on:
124
push:
13-
branches: [ "master" ] # Trigger the action on push to the master branch
5+
branches: ["master"]
146
pull_request:
15-
branches: [ "master" ] # Trigger the action on pull requests targeting the master branch
7+
branches: ["master"]
168

179
jobs:
1810
build:
19-
runs-on: ubuntu-latest # Use the latest version of Ubuntu for the build environment
11+
runs-on: ubuntu-latest
2012

2113
steps:
22-
# Step 1: Check out the code from the repository
23-
- name: Check out code
24-
uses: actions/checkout@v4
25-
26-
# Step 2: Set up JDK 21
27-
- name: Set up JDK 21
28-
uses: actions/setup-java@v4
29-
with:
30-
java-version: '21'
31-
distribution: 'temurin' # Use the Temurin distribution for OpenJDK
32-
cache: maven # Cache Maven dependencies to speed up subsequent builds
33-
34-
# Step 3: Clean and build with Maven
35-
- name: Build with Maven
36-
run: mvn -B clean package --file pom.xml # Build the project with Maven, suppress the interactive mode
37-
38-
# Step 4: Run Tests
39-
# - name: Run Tests
40-
# run: mvn test --file pom.xml # Run the tests to ensure the code works as expected
41-
42-
# # Step 5: Upload the built JAR file as an artifact
43-
# - name: Upload JAR Artifact
44-
# uses: actions/upload-artifact@v4
45-
# with:
46-
# name: backupmanager-jar # Name of the artifact
47-
# path: target/BackupManager-1.0-SNAPSHOT-jar-with-dependencies.jar # Path to the JAR file
14+
- uses: actions/checkout@v4
4815

49-
# # Step 6: Static Code Analysis with SpotBugs (optional)
50-
- name: Static Code Analysis with SpotBugs
51-
run: mvn com.github.spotbugs:spotbugs-maven-plugin:spotbugs # Run SpotBugs for static code analysis
16+
- name: Setup JDK 21
17+
uses: actions/setup-java@v4
18+
with:
19+
distribution: temurin
20+
java-version: 21
21+
cache: maven
5222

53-
# # Step 7: Update dependency graph to improve Dependabot alerts
54-
- name: Update dependency graph
55-
uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6 # Submit dependency graph for security monitoring
23+
- name: Build + Quality (skip tests)
24+
run: mvn -B clean verify -DskipTests=true
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
wrapperVersion=3.3.4
2+
distributionType=only-script
3+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.11/apache-maven-3.9.11-bin.zip

.vscode/java-formatter.xml

Lines changed: 382 additions & 0 deletions
Large diffs are not rendered by default.

.vscode/settings.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"java.configuration.updateBuildConfiguration": "interactive"
3-
}
2+
"java.configuration.updateBuildConfiguration": "interactive",
3+
"java.format.settings.url": ".vscode/java-formatter.xml"
4+
}

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,15 @@ $\rightarrow$ [Code tecnical documentation](./docs/code_documentation.md)
5656
| German ||
5757
| French ||
5858

59+
## Code Quality
60+
61+
This project enforces automatic code quality checks during the Maven verify phase.
62+
Running the following command will execute formatting checks, static analysis, and tests:
63+
64+
`mvn clean verify`
65+
66+
If any rule is violated, the build will fail.
67+
5968
## Licence
6069

6170
[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](https://choosealicense.com/licenses/mit/)

0 commit comments

Comments
 (0)