Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Maven Checkstyle plugin and Add Checkstyle to CI #832

Merged
merged 5 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/backoffice-bff-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ jobs:
- uses: ./.github/workflows/actions
- name: Run Maven Build Command
run: mvn clean install -DskipTests -f backoffice-bff
- name: Run Maven Checkstyle
run: mvn checkstyle:checkstyle -f backoffice-bff
- uses: jwgmeligmeyling/checkstyle-github-action@master
with:
path: '**/checkstyle-result.xml'
- name: Analyze with sonar cloud
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' }}
env:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/cart-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ jobs:
- uses: ./.github/workflows/actions
- name: Run Maven Build Command
run: mvn clean install -DskipTests -pl cart -am
- name: Run Maven Checkstyle
run: mvn checkstyle:checkstyle -pl cart -am
- uses: jwgmeligmeyling/checkstyle-github-action@master
with:
path: '**/checkstyle-result.xml'
- name: Run Maven Test
run: mvn test -pl cart -am
- name: Unit Test Results
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/customer-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ jobs:
- uses: ./.github/workflows/actions
- name: Run Maven Build Command
run: mvn clean install -DskipTests -f customer
- name: Run Maven Checkstyle
run: mvn checkstyle:checkstyle -f customer
- uses: jwgmeligmeyling/checkstyle-github-action@master
with:
path: '**/checkstyle-result.xml'
- name: Run Maven Test
run: mvn test -f customer
- name: Unit Test Results
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/inventory-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ jobs:
- uses: ./.github/workflows/actions
- name: Run Maven Build Command
run: mvn clean install -DskipTests -f inventory
- name: Run Maven Checkstyle
run: mvn checkstyle:checkstyle -f inventory
- uses: jwgmeligmeyling/checkstyle-github-action@master
with:
path: '**/checkstyle-result.xml'
- name: Run Maven Unit Test
run: mvn test -f inventory
- name: Run Maven Integration Test
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/location-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ jobs:
- uses: ./.github/workflows/actions
- name: Run Maven Build Command
run: mvn clean install -DskipTests -f location
- name: Run Maven Checkstyle
run: mvn checkstyle:checkstyle -f location
- uses: jwgmeligmeyling/checkstyle-github-action@master
with:
path: '**/checkstyle-result.xml'
- name: Run Maven Test
run: mvn test -f location
- name: Unit Test Results
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/media-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ jobs:
- uses: ./.github/workflows/actions
- name: Run Maven Build Command
run: mvn clean install -DskipTests -f media
- name: Run Maven Checkstyle
run: mvn checkstyle:checkstyle -f media
- uses: jwgmeligmeyling/checkstyle-github-action@master
with:
path: '**/checkstyle-result.xml'
- name: Run Maven Test
run: mvn test -f media
- name: Unit Test Results
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/order-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ jobs:
- uses: ./.github/workflows/actions
- name: Run Maven Build Command
run: mvn clean install -DskipTests -pl order -am
- name: Run Maven Checkstyle
run: mvn checkstyle:checkstyle -pl order -am
- uses: jwgmeligmeyling/checkstyle-github-action@master
with:
path: '**/checkstyle-result.xml'
- name: Run Maven Test
run: mvn test -pl order -am
- name: Unit Test Results
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/payment-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ jobs:
- uses: ./.github/workflows/actions
- name: Run Maven Build Command
run: mvn clean install -DskipTests -pl payment -am
- name: Run Maven Checkstyle
run: mvn checkstyle:checkstyle -pl payment -am
- uses: jwgmeligmeyling/checkstyle-github-action@master
with:
path: '**/checkstyle-result.xml'
- name: Run Maven Test
run: mvn test -pl payment -am
- name: Unit Test Results
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/payment-paypal-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ jobs:
- uses: ./.github/workflows/actions
- name: Run Maven Build Command
run: mvn clean install -DskipTests -f payment-paypal
- name: Run Maven Checkstyle
run: mvn checkstyle:checkstyle -f payment-paypal
- uses: jwgmeligmeyling/checkstyle-github-action@master
with:
path: '**/checkstyle-result.xml'
- name: Run Maven Test
run: mvn test -f payment-paypal
- name: Unit Test Results
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/product-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ jobs:
- uses: ./.github/workflows/actions
- name: Run Maven Build Command
run: mvn clean install -DskipTests -pl product -am
- name: Run Maven Checkstyle
run: mvn checkstyle:checkstyle -pl product -am
- uses: jwgmeligmeyling/checkstyle-github-action@master
with:
path: '**/checkstyle-result.xml'
- name: Run Maven Test
run: mvn test -pl product -am
- name: Unit Test Results
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/promotion-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ jobs:
- uses: ./.github/workflows/actions
- name: Run Maven Build Command
run: mvn clean install -DskipTests -f promotion
- name: Run Maven Checkstyle
run: mvn checkstyle:checkstyle -f promotion
- uses: jwgmeligmeyling/checkstyle-github-action@master
with:
path: '**/checkstyle-result.xml'
- name: Run Maven Test
run: mvn test -f promotion
- name: Unit Test Results
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/rating-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ jobs:
- uses: ./.github/workflows/actions
- name: Run Maven Build Command
run: mvn clean install -DskipTests -f rating
- name: Run Maven Checkstyle
run: mvn checkstyle:checkstyle -f rating
- uses: jwgmeligmeyling/checkstyle-github-action@master
with:
path: '**/checkstyle-result.xml'
- name: Run Maven Test
run: mvn test -f rating
- name: Unit Test Results
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/search-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ jobs:
- uses: ./.github/workflows/actions
- name: Run Maven Build Command
run: mvn clean install -DskipTests -f search
- name: Run Maven Checkstyle
run: mvn checkstyle:checkstyle -f search
- uses: jwgmeligmeyling/checkstyle-github-action@master
with:
path: '**/checkstyle-result.xml'
- name: Run Maven Test
run: mvn test -f search
- name: Unit Test Results
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/storefront-bff-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ jobs:
- uses: ./.github/workflows/actions
- name: Run Maven Build Command
run: mvn clean install -DskipTests -f storefront-bff
- name: Run Maven Checkstyle
run: mvn checkstyle:checkstyle -f storefront-bff
- uses: jwgmeligmeyling/checkstyle-github-action@master
with:
path: '**/checkstyle-result.xml'
- name: Analyze with sonar cloud
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' }}
env:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/tax-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ jobs:
- uses: ./.github/workflows/actions
- name: Run Maven Build Command
run: mvn clean install -DskipTests -f tax
- name: Run Maven Checkstyle
run: mvn checkstyle:checkstyle -f tax
- uses: jwgmeligmeyling/checkstyle-github-action@master
with:
path: '**/checkstyle-result.xml'
- name: Run Maven Test
run: mvn test -f tax
- name: Unit Test Results
Expand Down
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,25 @@ YAS is a pet project aim to practice building a typical microservice application
2. docker-compose.search.yml for search service
3. docker-compose.o11y.yml for observability services

## Code Style Configuration:
Checkstyle configuration that checks the Google coding conventions from Google Java Style
that can be found at https://google.github.io/styleguide/javaguide.html

Checkstyle is very configurable. Be sure to read the documentation at
http://checkstyle.org (or in your downloaded distribution).

To completely disable a check, just comment it out or delete it from the file.
To suppress certain violations please review suppression filters.


Using google_checks.xml version 9.3:
https://github.com/checkstyle/checkstyle/blob/checkstyle-9.3/src/main/resources/google_checks.xml

For IntelliJ IDEA:
1. File -> Setting -> Editor -> Code Style -> Java
2. Import Scheme -> Checkstyle configuration
3. Apply file checkstyle/checkstyle.xml to import

## Deploy to Kubernetes
https://github.com/nashtech-garage/yas/tree/main/k8s/deploy

Expand Down
Loading
Loading