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

refractor: add auto format and validations #16

Closed
wants to merge 7 commits into from
Closed
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
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 spotless
run: |
# Skipping Docker image build for PR verification
mvn clean spotless:check
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
Client tools for building Quarkus java DIDcomm Verifiable Credential powered conversational service (Chatbots) with [2060.io Service Agent](https://github.com/2060-io/2060-service-agent/blob/main/doc/service-agent-api.md)

## How to use
On dev mode use the command `mvn clean install -Dgpg.skip` to run the project
On dev mode use the command `mvn clean verify install -Dgpg.skip` to run the project

## Before PR
Please run `mvn clean spotless:check` command before uploading changes to verify the syntax

## Releases

Expand Down
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>
54 changes: 54 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,60 @@
</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.43.0</version>
<configuration>
<java>
<eclipse>
<file>${basedir}/eclipse-formatter.xml</file>
</eclipse>
</java>
</configuration>
<!-- <executions>
<execution>
<id>check</id>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions> -->
</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
Loading