Add lin action and minor change to trigger it
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
name: Build with cached gradle
|
||||
run-name: Building for ${{ gitea.actor }}
|
||||
on: [push]
|
||||
on: [pull_request]
|
||||
|
||||
jobs:
|
||||
Build-with-gradle:
|
||||
@@ -9,7 +9,7 @@ jobs:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
distribution: 'zulu'
|
||||
java-version: '22'
|
||||
cache: 'gradle'
|
||||
# cache-dependency-path: | # optional
|
||||
|
||||
48
.gitea/workflows/linting.yml
Normal file
48
.gitea/workflows/linting.yml
Normal file
@@ -0,0 +1,48 @@
|
||||
name: Java Google Checkstyle
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pull-request: write
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
checkstyle:
|
||||
name: 'Checkstyle Linter'
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CHECKSTYLE_VERSION: '10.25.0'
|
||||
REVIEWDOG_VERSION: latest
|
||||
REVIEWDOG_GITEA_API_TOKEN: cce3e487b7da8f6a98168a066dc5347b7a61f12e
|
||||
GITEA_ADDRESS: http://gitea:3000
|
||||
steps:
|
||||
- name: 'Pull code'
|
||||
- uses: actions/checkoutv6
|
||||
- name: 'Find changed Java files'
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v44
|
||||
with:
|
||||
files: |
|
||||
**.java
|
||||
- name: 'Setup Java JDK'
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '22'
|
||||
distribution: 'zulu'
|
||||
- name: 'Setup Reviewdog'
|
||||
uses: reviewdog/action-setup@v1
|
||||
with:
|
||||
reviewdog_version: ${{ env.REVIEWDOG_VERSION }}
|
||||
- name: 'Run Checkstyle with Reviewdog'
|
||||
if: steps.changed-files.outputs.any_changed == 'true'
|
||||
run: |
|
||||
wget wget https://github.com/checkstyle/checkstyle/releases/download/checkstyle-${{ env.CHECKSTYLE_VERSION }}/checkstyle-${{ env.CHECKSTYLE_VERSION }}-all.jar
|
||||
|
||||
echo "${{ steps.changed-files.outputs.all_changed_files }}"
|
||||
|
||||
java -jar checkstyle-${{ env.CHECKSTYLE_VERSION }}-all.jar -c google_checks.xml -f xml ${{ steps.changed-files.outputs.all_changed_files }} \
|
||||
| reviewdog -f=checkstyle \
|
||||
-name="Checkstyle" \
|
||||
-reporter="gitea-pr-review" \
|
||||
-level="warning" \
|
||||
-fail-on-error="true"
|
||||
@@ -2,8 +2,10 @@ package com.softwaresmyth.functions;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
public class OrNot
|
||||
public enum OrNot
|
||||
{
|
||||
; // Enum with no variants for a utility class that is not meant to be instantiated.
|
||||
|
||||
public static void noop(Object... ignored)
|
||||
{
|
||||
//do nothing
|
||||
|
||||
Reference in New Issue
Block a user