Skip to content
Merged
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/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: check

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
component-color:
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v5

- name: run m4
run: m4 -P src/main/java/net/farlandsmc/componentutils/ComponentColor.java.m4 > src/main/java/net/farlandsmc/componentutils/ComponentColor.java

- name: check diff
run: |
set +e
git diff --quiet -- src/main/java/net/farlandsmc/componentutils/ComponentColor.java
status=$?
if [ $status -ne 0 ]; then
echo '::error file=src/main/java/net/farlandsmc/componentutils/ComponentColor.java,title=Update ComponentColor.java::ComponentColor.java is out of date with ComponentColor.java.m4! Update it with m4 -P src/main/java/net/farlandsmc/componentutils/ComponentColor.java.m4 > src/main/java/net/farlandsmc/componentutils/ComponentColor.java.'
exit $status
else
echo 'No diff'
fi
25 changes: 11 additions & 14 deletions src/main/java/net/farlandsmc/componentutils/ComponentColor.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@

// NOTE: This file is generated from ComponentColor.java.m4
// Generate with `m4 -P src/main/java/net/farlandsmc/componentutils/ComponentColor.java.m4 > src/main/java/net/farlandsmc/componentutils/ComponentColor.java`

package net.farlandsmc.componentutils;

import net.kyori.adventure.text.Component;
Expand Down Expand Up @@ -67,8 +71,7 @@ public static Component darkBlue(String format, Object... values) {
}

/**
* Generate a component with the colour of DARK_BLUE using {@link ComponentUtils#format} with the format of
* {@code {}}
* Generate a component with the colour of DARK_BLUE using {@link ComponentUtils#format} with the format of {@code {}}
*
* @param obj The object to format
*/
Expand Down Expand Up @@ -109,8 +112,7 @@ public static Component darkGreen(String format, Object... values) {
}

/**
* Generate a component with the colour of DARK_GREEN using {@link ComponentUtils#format} with the format of
* {@code {}}
* Generate a component with the colour of DARK_GREEN using {@link ComponentUtils#format} with the format of {@code {}}
*
* @param obj The object to format
*/
Expand Down Expand Up @@ -151,8 +153,7 @@ public static Component darkAqua(String format, Object... values) {
}

/**
* Generate a component with the colour of DARK_AQUA using {@link ComponentUtils#format} with the format of
* {@code {}}
* Generate a component with the colour of DARK_AQUA using {@link ComponentUtils#format} with the format of {@code {}}
*
* @param obj The object to format
*/
Expand Down Expand Up @@ -193,8 +194,7 @@ public static Component darkRed(String format, Object... values) {
}

/**
* Generate a component with the colour of DARK_RED using {@link ComponentUtils#format} with the format of
* {@code {}}
* Generate a component with the colour of DARK_RED using {@link ComponentUtils#format} with the format of {@code {}}
*
* @param obj The object to format
*/
Expand Down Expand Up @@ -235,8 +235,7 @@ public static Component darkPurple(String format, Object... values) {
}

/**
* Generate a component with the colour of DARK_PURPLE using {@link ComponentUtils#format} with the format of
* {@code {}}
* Generate a component with the colour of DARK_PURPLE using {@link ComponentUtils#format} with the format of {@code {}}
*
* @param obj The object to format
*/
Expand Down Expand Up @@ -359,8 +358,7 @@ public static Component darkGray(String format, Object... values) {
}

/**
* Generate a component with the colour of DARK_GRAY using {@link ComponentUtils#format} with the format of
* {@code {}}
* Generate a component with the colour of DARK_GRAY using {@link ComponentUtils#format} with the format of {@code {}}
*
* @param obj The object to format
*/
Expand Down Expand Up @@ -565,8 +563,7 @@ public static Component lightPurple(String format, Object... values) {
}

/**
* Generate a component with the colour of LIGHT_PURPLE using {@link ComponentUtils#format} with the format of
* {@code {}}
* Generate a component with the colour of LIGHT_PURPLE using {@link ComponentUtils#format} with the format of {@code {}}
*
* @param obj The object to format
*/
Expand Down
Loading