Skip to content

Commit

Permalink
Updating checkstyle (#6)
Browse files Browse the repository at this point in the history
* Updating checkstyle

* Updating checkstlye profile info

* Fixing validation error
  • Loading branch information
Jaland authored Nov 21, 2024
1 parent 7054bad commit 491735c
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
run: |
curl -L https://huggingface.co/nomic-ai/nomic-embed-text-v1/resolve/main/onnx/model_quantized.onnx?download=true --output src/main/resources/embeddings/nomic/model.onnx
- name: Build with Maven
run: mvn -B package --file pom.xml
run: mvn -B package --file pom.xml -P github-action
- name: Archive target folder
uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<property name="charset" value="UTF-8"/>

<property name="severity" value="${org.checkstyle.google.severity}" default="error"/>
<property name="severity" value="${org.checkstyle.google.severity}" default="warning"/>

<property name="fileExtensions" value="java, properties, xml"/>
<!-- Excludes all 'module-info.java' files -->
Expand Down
58 changes: 58 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,11 @@
<configuration>
<configLocation>checkstyle.xml</configLocation>
<suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation>
<failOnViolation>true</failOnViolation>
</configuration>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>check</goal>
</goals>
Expand All @@ -257,6 +259,33 @@
</properties>
</profile>

<!-- Profile used in the Github Action -->
<profile>
<id>github-action</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${checkstyle-maven-plugin.version}</version>
<configuration>
<configLocation>checkstyle.xml</configLocation>
<suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation>
<violationSeverity>warning</violationSeverity>
<failOnViolation>true</failOnViolation>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>


<profile>
<id>security-scanner</id>
Expand Down Expand Up @@ -284,6 +313,34 @@
</plugins>
</build>
</profile>

<profile>
<id>checkstyle</id>
<build>
<plugins>
<!-- Checkstyle Plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${checkstyle-maven-plugin.version}</version>
<configuration>
<configLocation>checkstyle.xml</configLocation>
<suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation>
<failOnViolation>true</failOnViolation>
<violationSeverity>warning</violationSeverity>
</configuration>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<reporting>
Expand All @@ -295,6 +352,7 @@
<configuration>
<configLocation>checkstyle.xml</configLocation>
<suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation>
<failOnViolation>true</failOnViolation>
</configuration>
</plugin>
</plugins>
Expand Down

0 comments on commit 491735c

Please sign in to comment.