Skip to content

Commit

Permalink
refractor: add auto format and validations
Browse files Browse the repository at this point in the history
  • Loading branch information
lotharking committed Oct 3, 2024
1 parent 5dc9cd1 commit 41d3942
Show file tree
Hide file tree
Showing 66 changed files with 1,016 additions and 903 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: PR Check

on:
pull_request:
branches: [ main, dev ]

env:
QUARKUS_CONTAINER_IMAGE_USERNAME: ${{ secrets.DOCKER_HUB_LOGIN }}
QUARKUS_CONTAINER_IMAGE_PASSWORD: ${{ secrets.DOCKER_HUB_PWD }}

jobs:
pr_check:
runs-on: ubuntu-latest
steps:
- name: Checkout gh-repo
uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
cache: maven

- name: Clean and verify
run: |
# Skipping Docker image build for PR verification
mvn clean verify -Dgpg.skip
20 changes: 20 additions & 0 deletions eclipse-formatter.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="13">
<profile kind="CodeFormatterProfile" name="Custom" version="13">
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="tab"/>
<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_enum_constant" value="49"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="120"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="49"/>
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="0"/>
</profile>
</profiles>
46 changes: 46 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,52 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<version>2.19.0</version>
<configuration>
<configFile>eclipse-formatter.xml</configFile>
<lineEnding>LF</lineEnding>
</configuration>
<executions>
<execution>
<goals>
<goal>format</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>net.revelc.code</groupId>
<artifactId>impsort-maven-plugin</artifactId>
<version>1.8.0</version>
<configuration>
<groups>java.,javax.,org.,com.</groups>
<staticGroups>java,*</staticGroups>
<removeUnused>true</removeUnused>
</configuration>
<executions>
<execution>
<id>sort-imports</id>
<goals>
<goal>sort</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.17.5</version>
<configuration>
<java>
<eclipse>
<file>${basedir}/eclipse-formatter.xml</file> <!-- Apunta a tu archivo de formateo XML -->
</eclipse>
</java>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
Expand Down
128 changes: 64 additions & 64 deletions src/main/java/io/twentysixty/sa/client/enums/Mrz.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,69 +15,69 @@
@Setter
@ToString
public class Mrz {
public enum Format {
@JsonProperty("TD1")
TD1,
@JsonProperty("TD2")
TD2,
@JsonProperty("TD3")
TD3,
@JsonProperty("FRENCH_NATIONAL_ID")
FRENCH_NATIONAL_ID,
@JsonProperty("FRENCH_DRIVING_LICENSE")
FRENCH_DRIVING_LICENSE,
@JsonProperty("SWISS_DRIVING_LICENSE")
SWISS_DRIVING_LICENSE;
}
public enum Format {
@JsonProperty("TD1")
TD1,
@JsonProperty("TD2")
TD2,
@JsonProperty("TD3")
TD3,
@JsonProperty("FRENCH_NATIONAL_ID")
FRENCH_NATIONAL_ID,
@JsonProperty("FRENCH_DRIVING_LICENSE")
FRENCH_DRIVING_LICENSE,
@JsonProperty("SWISS_DRIVING_LICENSE")
SWISS_DRIVING_LICENSE;
}

public enum FieldName {
@JsonProperty("administrativeCode")
ADMINISTRATIVE_CODE,
@JsonProperty("administrativeCode2")
ADMINISTRATIVE_CODE2,
@JsonProperty("birthDate")
BIRTH_DATE,
@JsonProperty("birthDateCheckDigit")
BIRTH_DATE_CHECK_DIGIT,
@JsonProperty("compositeCheckDigit")
COMPOSITE_CHECK_DIGIT,
@JsonProperty("documentNumber")
DOCUMENT_NUMBER,
@JsonProperty("documentNumberCheckDigit")
DOCUMENT_NUMBER_CHECK_DIGIT,
@JsonProperty("documentCode")
DOCUMENT_CODE,
@JsonProperty("expirationDate")
EXPIRATION_DATE,
@JsonProperty("expirationDateCheckDigit")
EXPIRATION_DATE_CHECK_DIGIT,
@JsonProperty("firstName")
FIRST_NAME,
@JsonProperty("issueDate")
ISSUE_DATE,
@JsonProperty("issuingState")
ISSUING_STATE,
@JsonProperty("languageCode")
LANGUAGE_CODE,
@JsonProperty("lastName")
LAST_NAME,
@JsonProperty("nationality")
NATIONALITY,
@JsonProperty("optional")
OPTIONAL,
@JsonProperty("optional1")
OPTIONAL1,
@JsonProperty("optional2")
OPTIONAL2,
@JsonProperty("personalNumber")
PERSONAL_NUMBER,
@JsonProperty("personalNumberCheckDigit")
PERSONAL_NUMBER_CHECK_DIGIT,
@JsonProperty("pinCode")
PIN_CODE,
@JsonProperty("sex")
SEX,
@JsonProperty("versionNumber")
VERSION_NUMBER;
}
public enum FieldName {
@JsonProperty("administrativeCode")
ADMINISTRATIVE_CODE,
@JsonProperty("administrativeCode2")
ADMINISTRATIVE_CODE2,
@JsonProperty("birthDate")
BIRTH_DATE,
@JsonProperty("birthDateCheckDigit")
BIRTH_DATE_CHECK_DIGIT,
@JsonProperty("compositeCheckDigit")
COMPOSITE_CHECK_DIGIT,
@JsonProperty("documentNumber")
DOCUMENT_NUMBER,
@JsonProperty("documentNumberCheckDigit")
DOCUMENT_NUMBER_CHECK_DIGIT,
@JsonProperty("documentCode")
DOCUMENT_CODE,
@JsonProperty("expirationDate")
EXPIRATION_DATE,
@JsonProperty("expirationDateCheckDigit")
EXPIRATION_DATE_CHECK_DIGIT,
@JsonProperty("firstName")
FIRST_NAME,
@JsonProperty("issueDate")
ISSUE_DATE,
@JsonProperty("issuingState")
ISSUING_STATE,
@JsonProperty("languageCode")
LANGUAGE_CODE,
@JsonProperty("lastName")
LAST_NAME,
@JsonProperty("nationality")
NATIONALITY,
@JsonProperty("optional")
OPTIONAL,
@JsonProperty("optional1")
OPTIONAL1,
@JsonProperty("optional2")
OPTIONAL2,
@JsonProperty("personalNumber")
PERSONAL_NUMBER,
@JsonProperty("personalNumberCheckDigit")
PERSONAL_NUMBER_CHECK_DIGIT,
@JsonProperty("pinCode")
PIN_CODE,
@JsonProperty("sex")
SEX,
@JsonProperty("versionNumber")
VERSION_NUMBER;
}
}
Loading

0 comments on commit 41d3942

Please sign in to comment.