Skip to content

Commit

Permalink
Add maven checkstyle plugin and Add Checkstyle to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
nashtech-hieunguyenchi5 committed Aug 6, 2024
1 parent e67029f commit d85a735
Show file tree
Hide file tree
Showing 39 changed files with 280 additions and 175 deletions.
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:check -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
4 changes: 3 additions & 1 deletion cart/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.yas</groupId>
Expand Down
6 changes: 3 additions & 3 deletions cart/src/main/java/com/yas/cart/CartApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
@EnableConfigurationProperties(ServiceUrlConfig.class)
public class CartApplication {

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

Check warning on line 12 in cart/src/main/java/com/yas/cart/CartApplication.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def modifier' has incorrect indentation level 4, expected level should be 2.
SpringApplication.run(CartApplication.class, args);

Check warning on line 13 in cart/src/main/java/com/yas/cart/CartApplication.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def' child has incorrect indentation level 8, expected level should be 4.
}

Check warning on line 14 in cart/src/main/java/com/yas/cart/CartApplication.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def rcurly' has incorrect indentation level 4, expected level should be 2.
}
1 change: 1 addition & 0 deletions cart/src/main/java/com/yas/cart/config/CorsConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

@Configuration

Check warning on line 8 in cart/src/main/java/com/yas/cart/config/CorsConfig.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocTypeCheck

Missing a Javadoc comment.
public class CorsConfig {

@Bean

Check warning on line 11 in cart/src/main/java/com/yas/cart/config/CorsConfig.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def modifier' has incorrect indentation level 4, expected level should be 2.

Check warning on line 11 in cart/src/main/java/com/yas/cart/config/CorsConfig.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck

Missing a Javadoc comment.
public WebMvcConfigurer corsConfigure() {
return new WebMvcConfigurer() {

Check warning on line 13 in cart/src/main/java/com/yas/cart/config/CorsConfig.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def' child has incorrect indentation level 8, expected level should be 4.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ public class DatabaseAutoConfig {
public AuditorAware<String> auditorAware() {
return () -> {

Check warning on line 22 in cart/src/main/java/com/yas/cart/config/DatabaseAutoConfig.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def' child has incorrect indentation level 8, expected level should be 4.
Authentication auth = SecurityContextHolder.getContext().getAuthentication();

Check warning on line 23 in cart/src/main/java/com/yas/cart/config/DatabaseAutoConfig.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'block' child has incorrect indentation level 12, expected level should be 10.
if (auth == null) return Optional.of("");
if (auth == null) {

Check warning on line 24 in cart/src/main/java/com/yas/cart/config/DatabaseAutoConfig.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'if' has incorrect indentation level 12, expected level should be 10.
return Optional.of("");

Check warning on line 25 in cart/src/main/java/com/yas/cart/config/DatabaseAutoConfig.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'if' child has incorrect indentation level 16, expected level should be 12.
}

Check warning on line 26 in cart/src/main/java/com/yas/cart/config/DatabaseAutoConfig.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'if rcurly' has incorrect indentation level 12, expected level should be 10.
return Optional.of(auth.getName());

Check warning on line 27 in cart/src/main/java/com/yas/cart/config/DatabaseAutoConfig.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'block' child has incorrect indentation level 12, expected level should be 10.
};
}

Check warning on line 29 in cart/src/main/java/com/yas/cart/config/DatabaseAutoConfig.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def rcurly' has incorrect indentation level 4, expected level should be 2.
Expand Down
8 changes: 4 additions & 4 deletions cart/src/main/java/com/yas/cart/config/RestClientConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
@Configuration

Check warning on line 7 in cart/src/main/java/com/yas/cart/config/RestClientConfig.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocTypeCheck

Missing a Javadoc comment.
public class RestClientConfig {

@Bean
public RestClient restClient() {
return RestClient.builder().build();
}
@Bean

Check warning on line 10 in cart/src/main/java/com/yas/cart/config/RestClientConfig.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def modifier' has incorrect indentation level 4, expected level should be 2.
public RestClient restClient() {
return RestClient.builder().build();

Check warning on line 12 in cart/src/main/java/com/yas/cart/config/RestClientConfig.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def' child has incorrect indentation level 8, expected level should be 4.
}

Check warning on line 13 in cart/src/main/java/com/yas/cart/config/RestClientConfig.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def rcurly' has incorrect indentation level 4, expected level should be 2.

}
16 changes: 9 additions & 7 deletions cart/src/main/java/com/yas/cart/config/SecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,18 @@

@Configuration

Check warning on line 18 in cart/src/main/java/com/yas/cart/config/SecurityConfig.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocTypeCheck

Missing a Javadoc comment.
public class SecurityConfig {

@Bean

Check warning on line 21 in cart/src/main/java/com/yas/cart/config/SecurityConfig.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def modifier' has incorrect indentation level 4, expected level should be 2.

Check warning on line 21 in cart/src/main/java/com/yas/cart/config/SecurityConfig.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck

Missing a Javadoc comment.
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {

return http

Check warning on line 24 in cart/src/main/java/com/yas/cart/config/SecurityConfig.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def' child has incorrect indentation level 8, expected level should be 4.
.authorizeHttpRequests(auth -> auth
.requestMatchers("/actuator/prometheus", "/actuator/health/**",
"/swagger-ui", "/swagger-ui/**", "/error", "/v3/api-docs/**").permitAll()
.requestMatchers("/storefront/carts", "/storefront/carts/**").hasRole("CUSTOMER")
.requestMatchers("/storefront/**").permitAll()
.requestMatchers("/backoffice/**").hasRole("ADMIN")
.anyRequest().authenticated())
.requestMatchers("/actuator/prometheus", "/actuator/health/**",
"/swagger-ui", "/swagger-ui/**", "/error", "/v3/api-docs/**").permitAll()

Check warning on line 27 in cart/src/main/java/com/yas/cart/config/SecurityConfig.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck

Line is longer than 100 characters (found 105).
.requestMatchers("/storefront/carts", "/storefront/carts/**").hasRole("CUSTOMER")

Check warning on line 28 in cart/src/main/java/com/yas/cart/config/SecurityConfig.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck

Line is longer than 100 characters (found 105).
.requestMatchers("/storefront/**").permitAll()
.requestMatchers("/backoffice/**").hasRole("ADMIN")
.anyRequest().authenticated())
.oauth2ResourceServer(oauth2 -> oauth2.jwt(Customizer.withDefaults()))
.build();
}

Check warning on line 34 in cart/src/main/java/com/yas/cart/config/SecurityConfig.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def rcurly' has incorrect indentation level 4, expected level should be 2.
Expand All @@ -43,7 +44,8 @@ public JwtAuthenticationConverter jwtAuthenticationConverterForKeycloak() {
};

var jwtAuthenticationConverter = new JwtAuthenticationConverter();

Check warning on line 46 in cart/src/main/java/com/yas/cart/config/SecurityConfig.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def' child has incorrect indentation level 8, expected level should be 4.
jwtAuthenticationConverter.setJwtGrantedAuthoritiesConverter(jwtGrantedAuthoritiesConverter);
jwtAuthenticationConverter.setJwtGrantedAuthoritiesConverter(

Check warning on line 47 in cart/src/main/java/com/yas/cart/config/SecurityConfig.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def' child has incorrect indentation level 8, expected level should be 4.
jwtGrantedAuthoritiesConverter);

return jwtAuthenticationConverter;

Check warning on line 50 in cart/src/main/java/com/yas/cart/config/SecurityConfig.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def' child has incorrect indentation level 8, expected level should be 4.
}

Check warning on line 51 in cart/src/main/java/com/yas/cart/config/SecurityConfig.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def rcurly' has incorrect indentation level 4, expected level should be 2.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@

@ConfigurationProperties(prefix = "yas.services")

Check warning on line 5 in cart/src/main/java/com/yas/cart/config/ServiceUrlConfig.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocTypeCheck

Missing a Javadoc comment.
public record ServiceUrlConfig(String media, String product) {

}
1 change: 1 addition & 0 deletions cart/src/main/java/com/yas/cart/config/SwaggerConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@
@OAuthScope(name = "openid", description = "openid")

Check warning on line 13 in cart/src/main/java/com/yas/cart/config/SwaggerConfig.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'annotation array initialization' child has incorrect indentation level 16, expected level should be one of the following: 10, 12.
})))
public class SwaggerConfig {

}
19 changes: 13 additions & 6 deletions cart/src/main/java/com/yas/cart/controller/CartController.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
@Validated

Check warning on line 22 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocTypeCheck

Missing a Javadoc comment.
@RestController
public class CartController {

private final CartService cartService;

Check warning on line 26 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'member def modifier' has incorrect indentation level 4, expected level should be 2.

public CartController(CartService cartService) {

Check warning on line 28 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'ctor def modifier' has incorrect indentation level 4, expected level should be 2.
Expand All @@ -34,14 +35,16 @@ public ResponseEntity<List<CartListVm>> listCarts() {
}

Check warning on line 35 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def rcurly' has incorrect indentation level 4, expected level should be 2.

@GetMapping("/backoffice/carts/{customerId}")

Check warning on line 37 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def modifier' has incorrect indentation level 4, expected level should be 2.
public ResponseEntity<List<CartGetDetailVm>> listCartDetailByCustomerId(@PathVariable String customerId) {
public ResponseEntity<List<CartGetDetailVm>> listCartDetailByCustomerId(
@PathVariable String customerId) {
return ResponseEntity.ok(cartService.getCartDetailByCustomerId(customerId));

Check warning on line 40 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def' child has incorrect indentation level 8, expected level should be 4.
}

Check warning on line 41 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def rcurly' has incorrect indentation level 4, expected level should be 2.

@GetMapping("/storefront/carts")

Check warning on line 43 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def modifier' has incorrect indentation level 4, expected level should be 2.

Check warning on line 43 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck

Missing a Javadoc comment.
public ResponseEntity<CartGetDetailVm> getLastCart(Principal principal) {
if (principal == null)
if (principal == null) {

Check warning on line 45 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'if' has incorrect indentation level 8, expected level should be 4.
return ResponseEntity.ok(null);

Check warning on line 46 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'if' child has incorrect indentation level 12, expected level should be 6.
}

Check warning on line 47 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'if rcurly' has incorrect indentation level 8, expected level should be 4.
return ResponseEntity.ok(cartService.getLastCart(principal.getName()));

Check warning on line 48 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def' child has incorrect indentation level 8, expected level should be 4.
}

Check warning on line 49 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def rcurly' has incorrect indentation level 4, expected level should be 2.

Expand All @@ -51,15 +54,17 @@ public ResponseEntity<CartGetDetailVm> getLastCart(Principal principal) {
@ApiResponse(responseCode = "201", description = "Add to cart successfully", content = @Content(schema = @Schema(implementation = CartGetDetailVm.class))),

Check warning on line 54 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck

Line is longer than 100 characters (found 167).

Check warning on line 54 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'annotation array initialization' child has incorrect indentation level 12, expected level should be one of the following: 6, 8.
@ApiResponse(responseCode = "404", description = "Not found", content = @Content(schema = @Schema(implementation = ErrorVm.class))),

Check warning on line 55 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck

Line is longer than 100 characters (found 144).

Check warning on line 55 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'annotation array initialization' child has incorrect indentation level 12, expected level should be one of the following: 6, 8.
@ApiResponse(responseCode = "400", description = "Bad request", content = @Content(schema = @Schema(implementation = ErrorVm.class)))})

Check warning on line 56 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck

Line is longer than 100 characters (found 147).

Check warning on line 56 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'annotation array initialization' child has incorrect indentation level 12, expected level should be one of the following: 6, 8.
public ResponseEntity<CartGetDetailVm> createCart(@Valid @RequestBody @NotEmpty List<CartItemVm> cartItemVms) {
public ResponseEntity<CartGetDetailVm> createCart(
@Valid @RequestBody @NotEmpty List<CartItemVm> cartItemVms) {
CartGetDetailVm cartGetDetailVm = cartService.addToCart(cartItemVms);

Check warning on line 59 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def' child has incorrect indentation level 8, expected level should be 4.
return new ResponseEntity<>(cartGetDetailVm, HttpStatus.CREATED);

Check warning on line 60 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def' child has incorrect indentation level 8, expected level should be 4.
}

Check warning on line 61 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def rcurly' has incorrect indentation level 4, expected level should be 2.

@PutMapping("cart-item")

Check warning on line 63 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def modifier' has incorrect indentation level 4, expected level should be 2.

Check warning on line 63 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck

Missing a Javadoc comment.
public ResponseEntity<CartItemPutVm> updateCart(@Valid @RequestBody CartItemVm cartItemVm) {
Authentication auth = SecurityContextHolder.getContext().getAuthentication();

Check warning on line 65 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def' child has incorrect indentation level 8, expected level should be 4.
return new ResponseEntity<>(cartService.updateCartItems(cartItemVm, auth.getName()), HttpStatus.OK);
return new ResponseEntity<>(cartService.updateCartItems(cartItemVm, auth.getName()),

Check warning on line 66 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def' child has incorrect indentation level 8, expected level should be 4.
HttpStatus.OK);
}

Check warning on line 68 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def rcurly' has incorrect indentation level 4, expected level should be 2.

@DeleteMapping("/storefront/cart-item")

Check warning on line 70 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def modifier' has incorrect indentation level 4, expected level should be 2.

Check warning on line 70 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck

Missing a Javadoc comment.
Expand All @@ -70,16 +75,18 @@ public ResponseEntity<Void> removeCartItemByProductId(@RequestParam Long product
}

Check warning on line 75 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def rcurly' has incorrect indentation level 4, expected level should be 2.

@DeleteMapping("/storefront/cart-item/multi-delete")

Check warning on line 77 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def modifier' has incorrect indentation level 4, expected level should be 2.

Check warning on line 77 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck

Missing a Javadoc comment.
public ResponseEntity<Void> removeCartItemListByProductIdList(@RequestParam List<Long> productIds) {
public ResponseEntity<Void> removeCartItemListByProductIdList(
@RequestParam List<Long> productIds) {
Authentication auth = SecurityContextHolder.getContext().getAuthentication();

Check warning on line 80 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def' child has incorrect indentation level 8, expected level should be 4.
cartService.removeCartItemListByProductIdList(productIds, auth.getName());

Check warning on line 81 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def' child has incorrect indentation level 8, expected level should be 4.
return ResponseEntity.noContent().build();

Check warning on line 82 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def' child has incorrect indentation level 8, expected level should be 4.
}

Check warning on line 83 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def rcurly' has incorrect indentation level 4, expected level should be 2.

@GetMapping(path = "/storefront/count-cart-items")

Check warning on line 85 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def modifier' has incorrect indentation level 4, expected level should be 2.

Check warning on line 85 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck

Missing a Javadoc comment.
public ResponseEntity<Long> getNumberItemInCart(Principal principal) {
if (principal == null)
if (principal == null) {

Check warning on line 87 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'if' has incorrect indentation level 8, expected level should be 4.
return ResponseEntity.ok().body(0L);

Check warning on line 88 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'if' child has incorrect indentation level 12, expected level should be 6.
}

Check warning on line 89 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'if rcurly' has incorrect indentation level 8, expected level should be 4.
return ResponseEntity.ok().body(cartService.countNumberItemInCart(principal.getName()));

Check warning on line 90 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def' child has incorrect indentation level 8, expected level should be 4.
}

Check warning on line 91 in cart/src/main/java/com/yas/cart/controller/CartController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def rcurly' has incorrect indentation level 4, expected level should be 2.

Expand Down
84 changes: 45 additions & 39 deletions cart/src/main/java/com/yas/cart/exception/ApiExceptionHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,49 +16,55 @@
@ControllerAdvice

Check warning on line 16 in cart/src/main/java/com/yas/cart/exception/ApiExceptionHandler.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocTypeCheck

Missing a Javadoc comment.
@Slf4j
public class ApiExceptionHandler {
private static final String ERROR_LOG_FORMAT = "Error: URI: {}, ErrorCode: {}, Message: {}";

@ExceptionHandler(NotFoundException.class)
public ResponseEntity<ErrorVm> handleNotFoundException(NotFoundException ex, WebRequest request) {
String message = ex.getMessage();
ErrorVm errorVm = new ErrorVm(HttpStatus.NOT_FOUND.toString(), "NotFound", message);
log.warn(ERROR_LOG_FORMAT, this.getServletPath(request), 404, message);
log.debug(ex.toString());
return new ResponseEntity<>(errorVm, HttpStatus.NOT_FOUND);
}
private static final String ERROR_LOG_FORMAT = "Error: URI: {}, ErrorCode: {}, Message: {}";

Check warning on line 20 in cart/src/main/java/com/yas/cart/exception/ApiExceptionHandler.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'member def modifier' has incorrect indentation level 4, expected level should be 2.

@ExceptionHandler(BadRequestException.class)
public ResponseEntity<ErrorVm> handleBadRequestException(BadRequestException ex, WebRequest request) {
String message = ex.getMessage();
ErrorVm errorVm = new ErrorVm(HttpStatus.BAD_REQUEST.toString(), "Bad request", message);
return ResponseEntity.badRequest().body(errorVm);
}
@ExceptionHandler(NotFoundException.class)

Check warning on line 22 in cart/src/main/java/com/yas/cart/exception/ApiExceptionHandler.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def modifier' has incorrect indentation level 4, expected level should be 2.

Check warning on line 22 in cart/src/main/java/com/yas/cart/exception/ApiExceptionHandler.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck

Missing a Javadoc comment.
public ResponseEntity<ErrorVm> handleNotFoundException(NotFoundException ex,
WebRequest request) {
String message = ex.getMessage();

Check warning on line 25 in cart/src/main/java/com/yas/cart/exception/ApiExceptionHandler.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def' child has incorrect indentation level 8, expected level should be 4.
ErrorVm errorVm = new ErrorVm(HttpStatus.NOT_FOUND.toString(), "NotFound", message);

Check warning on line 26 in cart/src/main/java/com/yas/cart/exception/ApiExceptionHandler.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def' child has incorrect indentation level 8, expected level should be 4.
log.warn(ERROR_LOG_FORMAT, this.getServletPath(request), HttpStatus.NOT_FOUND, message);

Check warning on line 27 in cart/src/main/java/com/yas/cart/exception/ApiExceptionHandler.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def' child has incorrect indentation level 8, expected level should be 4.
log.debug(ex.toString());

Check warning on line 28 in cart/src/main/java/com/yas/cart/exception/ApiExceptionHandler.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def' child has incorrect indentation level 8, expected level should be 4.
return new ResponseEntity<>(errorVm, HttpStatus.NOT_FOUND);

Check warning on line 29 in cart/src/main/java/com/yas/cart/exception/ApiExceptionHandler.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def' child has incorrect indentation level 8, expected level should be 4.
}

Check warning on line 30 in cart/src/main/java/com/yas/cart/exception/ApiExceptionHandler.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def rcurly' has incorrect indentation level 4, expected level should be 2.

@ExceptionHandler(MethodArgumentNotValidException.class)
protected ResponseEntity<ErrorVm> handleMethodArgumentNotValid(MethodArgumentNotValidException ex, HttpHeaders headers,
HttpStatus status, WebRequest request) {
List<String> errors = ex.getBindingResult()
.getFieldErrors()
.stream()
.map(error -> error.getField() + " " + error.getDefaultMessage())
.toList();
@ExceptionHandler(BadRequestException.class)

Check warning on line 32 in cart/src/main/java/com/yas/cart/exception/ApiExceptionHandler.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def modifier' has incorrect indentation level 4, expected level should be 2.

Check warning on line 32 in cart/src/main/java/com/yas/cart/exception/ApiExceptionHandler.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck

Missing a Javadoc comment.
public ResponseEntity<ErrorVm> handleBadRequestException(BadRequestException ex,
WebRequest request) {
String message = ex.getMessage();

Check warning on line 35 in cart/src/main/java/com/yas/cart/exception/ApiExceptionHandler.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def' child has incorrect indentation level 8, expected level should be 4.
ErrorVm errorVm = new ErrorVm(HttpStatus.BAD_REQUEST.toString(), "Bad request", message);

Check warning on line 36 in cart/src/main/java/com/yas/cart/exception/ApiExceptionHandler.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def' child has incorrect indentation level 8, expected level should be 4.
return ResponseEntity.badRequest().body(errorVm);

Check warning on line 37 in cart/src/main/java/com/yas/cart/exception/ApiExceptionHandler.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def' child has incorrect indentation level 8, expected level should be 4.
}

Check warning on line 38 in cart/src/main/java/com/yas/cart/exception/ApiExceptionHandler.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def rcurly' has incorrect indentation level 4, expected level should be 2.

ErrorVm errorVm = new ErrorVm("400", "Bad Request", "Request information is not valid", errors);
return ResponseEntity.badRequest().body(errorVm);
}
@ExceptionHandler(MethodArgumentNotValidException.class)

Check warning on line 40 in cart/src/main/java/com/yas/cart/exception/ApiExceptionHandler.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def modifier' has incorrect indentation level 4, expected level should be 2.
protected ResponseEntity<ErrorVm> handleMethodArgumentNotValid(
MethodArgumentNotValidException ex, HttpHeaders headers,
HttpStatus status, WebRequest request) {
List<String> errors = ex.getBindingResult()

Check warning on line 44 in cart/src/main/java/com/yas/cart/exception/ApiExceptionHandler.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def' child has incorrect indentation level 8, expected level should be 4.
.getFieldErrors()
.stream()
.map(error -> error.getField() + " " + error.getDefaultMessage())
.toList();

@ExceptionHandler(Exception.class)
protected ResponseEntity<ErrorVm> handleOtherException(Exception ex, WebRequest request) {
String message = ex.getMessage();
ErrorVm errorVm = new ErrorVm(HttpStatus.INTERNAL_SERVER_ERROR.toString(),
HttpStatus.INTERNAL_SERVER_ERROR.getReasonPhrase(), message);
log.warn(ERROR_LOG_FORMAT, this.getServletPath(request), 500, message);
log.debug(ex.toString());
return new ResponseEntity<>(errorVm, HttpStatus.INTERNAL_SERVER_ERROR);
}
ErrorVm errorVm = new ErrorVm("400", "Bad Request", "Request information is not valid",

Check warning on line 50 in cart/src/main/java/com/yas/cart/exception/ApiExceptionHandler.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def' child has incorrect indentation level 8, expected level should be 4.
errors);
return ResponseEntity.badRequest().body(errorVm);

Check warning on line 52 in cart/src/main/java/com/yas/cart/exception/ApiExceptionHandler.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def' child has incorrect indentation level 8, expected level should be 4.
}

Check warning on line 53 in cart/src/main/java/com/yas/cart/exception/ApiExceptionHandler.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def rcurly' has incorrect indentation level 4, expected level should be 2.

private String getServletPath(WebRequest webRequest) {
ServletWebRequest servletRequest = (ServletWebRequest) webRequest;
return servletRequest.getRequest().getServletPath();
}
@ExceptionHandler(Exception.class)

Check warning on line 55 in cart/src/main/java/com/yas/cart/exception/ApiExceptionHandler.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def modifier' has incorrect indentation level 4, expected level should be 2.
protected ResponseEntity<ErrorVm> handleOtherException(Exception ex, WebRequest request) {
String message = ex.getMessage();

Check warning on line 57 in cart/src/main/java/com/yas/cart/exception/ApiExceptionHandler.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def' child has incorrect indentation level 8, expected level should be 4.
ErrorVm errorVm = new ErrorVm(HttpStatus.INTERNAL_SERVER_ERROR.toString(),

Check warning on line 58 in cart/src/main/java/com/yas/cart/exception/ApiExceptionHandler.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def' child has incorrect indentation level 8, expected level should be 4.
HttpStatus.INTERNAL_SERVER_ERROR.getReasonPhrase(), message);
log.warn(ERROR_LOG_FORMAT, this.getServletPath(request), HttpStatus.INTERNAL_SERVER_ERROR,

Check warning on line 60 in cart/src/main/java/com/yas/cart/exception/ApiExceptionHandler.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def' child has incorrect indentation level 8, expected level should be 4.
message);
log.debug(ex.toString());

Check warning on line 62 in cart/src/main/java/com/yas/cart/exception/ApiExceptionHandler.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def' child has incorrect indentation level 8, expected level should be 4.
return new ResponseEntity<>(errorVm, HttpStatus.INTERNAL_SERVER_ERROR);

Check warning on line 63 in cart/src/main/java/com/yas/cart/exception/ApiExceptionHandler.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def' child has incorrect indentation level 8, expected level should be 4.
}

Check warning on line 64 in cart/src/main/java/com/yas/cart/exception/ApiExceptionHandler.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def rcurly' has incorrect indentation level 4, expected level should be 2.

private String getServletPath(WebRequest webRequest) {

Check warning on line 66 in cart/src/main/java/com/yas/cart/exception/ApiExceptionHandler.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def modifier' has incorrect indentation level 4, expected level should be 2.
ServletWebRequest servletRequest = (ServletWebRequest) webRequest;

Check warning on line 67 in cart/src/main/java/com/yas/cart/exception/ApiExceptionHandler.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def' child has incorrect indentation level 8, expected level should be 4.
return servletRequest.getRequest().getServletPath();

Check warning on line 68 in cart/src/main/java/com/yas/cart/exception/ApiExceptionHandler.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def' child has incorrect indentation level 8, expected level should be 4.
}

Check warning on line 69 in cart/src/main/java/com/yas/cart/exception/ApiExceptionHandler.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def rcurly' has incorrect indentation level 4, expected level should be 2.
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.yas.cart.utils.MessagesUtils;

public class BadRequestException extends RuntimeException {

Check warning on line 5 in cart/src/main/java/com/yas/cart/exception/BadRequestException.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocTypeCheck

Missing a Javadoc comment.

private String message;

Check warning on line 7 in cart/src/main/java/com/yas/cart/exception/BadRequestException.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'member def modifier' has incorrect indentation level 4, expected level should be 2.

public BadRequestException(String errorCode, Object... var2) {

Check warning on line 9 in cart/src/main/java/com/yas/cart/exception/BadRequestException.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'ctor def modifier' has incorrect indentation level 4, expected level should be 2.
Expand Down
24 changes: 12 additions & 12 deletions cart/src/main/java/com/yas/cart/exception/NotFoundException.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

import com.yas.cart.utils.MessagesUtils;

public class NotFoundException extends RuntimeException{
public class NotFoundException extends RuntimeException {

Check warning on line 5 in cart/src/main/java/com/yas/cart/exception/NotFoundException.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocTypeCheck

Missing a Javadoc comment.

private String message;
private String message;

Check warning on line 7 in cart/src/main/java/com/yas/cart/exception/NotFoundException.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'member def modifier' has incorrect indentation level 4, expected level should be 2.

public NotFoundException(String errorCode, Object... var2) {
this.message = MessagesUtils.getMessage(errorCode, var2);
}
public NotFoundException(String errorCode, Object... var2) {

Check warning on line 9 in cart/src/main/java/com/yas/cart/exception/NotFoundException.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'ctor def modifier' has incorrect indentation level 4, expected level should be 2.
this.message = MessagesUtils.getMessage(errorCode, var2);

Check warning on line 10 in cart/src/main/java/com/yas/cart/exception/NotFoundException.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'ctor def' child has incorrect indentation level 8, expected level should be 4.
}

Check warning on line 11 in cart/src/main/java/com/yas/cart/exception/NotFoundException.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'ctor def rcurly' has incorrect indentation level 4, expected level should be 2.

@Override
public String getMessage() {
return message;
}
@Override

Check warning on line 13 in cart/src/main/java/com/yas/cart/exception/NotFoundException.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def modifier' has incorrect indentation level 4, expected level should be 2.
public String getMessage() {
return message;

Check warning on line 15 in cart/src/main/java/com/yas/cart/exception/NotFoundException.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def' child has incorrect indentation level 8, expected level should be 4.
}

Check warning on line 16 in cart/src/main/java/com/yas/cart/exception/NotFoundException.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def rcurly' has incorrect indentation level 4, expected level should be 2.

public void setMessage(String message) {
this.message = message;
}
public void setMessage(String message) {

Check warning on line 18 in cart/src/main/java/com/yas/cart/exception/NotFoundException.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def modifier' has incorrect indentation level 4, expected level should be 2.
this.message = message;

Check warning on line 19 in cart/src/main/java/com/yas/cart/exception/NotFoundException.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def' child has incorrect indentation level 8, expected level should be 4.
}

Check warning on line 20 in cart/src/main/java/com/yas/cart/exception/NotFoundException.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def rcurly' has incorrect indentation level 4, expected level should be 2.
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

@Configurable

Check warning on line 11 in cart/src/main/java/com/yas/cart/listener/CustomAuditingEntityListener.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocTypeCheck

Missing a Javadoc comment.
public class CustomAuditingEntityListener extends AuditingEntityListener {

public CustomAuditingEntityListener(ObjectFactory<AuditingHandler> handler) {

Check warning on line 14 in cart/src/main/java/com/yas/cart/listener/CustomAuditingEntityListener.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'ctor def modifier' has incorrect indentation level 4, expected level should be 2.
super.setAuditingHandler(handler);

Check warning on line 15 in cart/src/main/java/com/yas/cart/listener/CustomAuditingEntityListener.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'ctor def' child has incorrect indentation level 8, expected level should be 4.
}

Check warning on line 16 in cart/src/main/java/com/yas/cart/listener/CustomAuditingEntityListener.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'ctor def rcurly' has incorrect indentation level 4, expected level should be 2.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
@Setter
@EntityListeners(CustomAuditingEntityListener.class)
public class AbstractAuditEntity {

@CreationTimestamp

Check warning on line 21 in cart/src/main/java/com/yas/cart/model/AbstractAuditEntity.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'member def modifier' has incorrect indentation level 4, expected level should be 2.
private ZonedDateTime createdOn;

Expand Down
1 change: 1 addition & 0 deletions cart/src/main/java/com/yas/cart/model/Cart.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
@NoArgsConstructor
@AllArgsConstructor
public class Cart extends AbstractAuditEntity {

@Id

Check warning on line 18 in cart/src/main/java/com/yas/cart/model/Cart.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'member def modifier' has incorrect indentation level 4, expected level should be 2.
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
Expand Down
4 changes: 2 additions & 2 deletions cart/src/main/java/com/yas/cart/model/CartItem.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
package com.yas.cart.model;

import jakarta.persistence.*;

Check warning on line 3 in cart/src/main/java/com/yas/cart/model/CartItem.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck

Using the '.*' form of import should be avoided - jakarta.persistence.*.
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import jakarta.persistence.*;

@Entity

Check warning on line 9 in cart/src/main/java/com/yas/cart/model/CartItem.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocTypeCheck

Missing a Javadoc comment.
@Getter
@Setter
@Table(name = "cart_item")
@NoArgsConstructor
@AllArgsConstructor
public class CartItem {

@Id

Check warning on line 17 in cart/src/main/java/com/yas/cart/model/CartItem.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'member def modifier' has incorrect indentation level 4, expected level should be 2.
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

@Repository

Check warning on line 14 in cart/src/main/java/com/yas/cart/repository/CartItemRepository.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocTypeCheck

Missing a Javadoc comment.
public interface CartItemRepository extends JpaRepository<CartItem, Long> {

Set<CartItem> findAllByCart(Cart cart);

Check warning on line 17 in cart/src/main/java/com/yas/cart/repository/CartItemRepository.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def modifier' has incorrect indentation level 4, expected level should be 2.

Optional<CartItem> findByCartIdAndProductId(Long cartId, Long productId);

Check warning on line 19 in cart/src/main/java/com/yas/cart/repository/CartItemRepository.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def modifier' has incorrect indentation level 4, expected level should be 2.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package com.yas.cart.repository;

import java.util.List;

import com.yas.cart.model.Cart;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import com.yas.cart.model.Cart;
import java.util.List;

Check warning on line 7 in cart/src/main/java/com/yas/cart/repository/CartRepository.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.imports.CustomImportOrderCheck

Extra separation in import group before 'java.util.List'

Check warning on line 7 in cart/src/main/java/com/yas/cart/repository/CartRepository.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.imports.CustomImportOrderCheck

Wrong lexicographical order for 'java.util.List' import. Should be before 'org.springframework.stereotype.Repository'.

@Repository

Check warning on line 9 in cart/src/main/java/com/yas/cart/repository/CartRepository.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocTypeCheck

Missing a Javadoc comment.
public interface CartRepository extends JpaRepository<Cart, Long> {

List<Cart> findByCustomerId(String customerId);

Check warning on line 12 in cart/src/main/java/com/yas/cart/repository/CartRepository.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def modifier' has incorrect indentation level 4, expected level should be 2.

List<Cart> findByCustomerIdAndOrderIdIsNull(String customerId);

Check warning on line 14 in cart/src/main/java/com/yas/cart/repository/CartRepository.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck

'method def modifier' has incorrect indentation level 4, expected level should be 2.
Expand Down
Loading

0 comments on commit d85a735

Please sign in to comment.