mirror of
https://github.com/danieldemus/openhab-core.git
synced 2025-01-25 11:45:49 +01:00
Add compilation errors & SAT GitHub annotations (#2543)
Signed-off-by: Yannick Schaus <github@schaus.net>
This commit is contained in:
parent
917e268e68
commit
d4f62ed024
21
.github/openhab-compile-problems.json
vendored
Normal file
21
.github/openhab-compile-problems.json
vendored
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"problemMatcher": [
|
||||||
|
{
|
||||||
|
"owner": "openhab-compile-problems",
|
||||||
|
"severity": "error",
|
||||||
|
"pattern": [
|
||||||
|
{
|
||||||
|
"regexp": "Failed to execute goal.*Compilation failure"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"regexp": "^\\[ERROR\\] (.+\\.java):\\[(.+),(.+)\\] (.*)$",
|
||||||
|
"file": 1,
|
||||||
|
"line": 2,
|
||||||
|
"col": 3,
|
||||||
|
"message": 4,
|
||||||
|
"loop": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
13
.github/workflows/ci-build.yml
vendored
13
.github/workflows/ci-build.yml
vendored
@ -54,6 +54,11 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
maven-version: ${{ matrix.maven }}
|
maven-version: ${{ matrix.maven }}
|
||||||
|
|
||||||
|
- name: Register Problem Matchers
|
||||||
|
id: problem_matchers
|
||||||
|
run: |
|
||||||
|
echo "::add-matcher::.github/openhab-compile-problems.json"
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
id: build
|
id: build
|
||||||
run: './.github/scripts/maven-build'
|
run: './.github/scripts/maven-build'
|
||||||
@ -77,3 +82,11 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: sat-summary-report
|
name: sat-summary-report
|
||||||
path: target/summary_report.html
|
path: target/summary_report.html
|
||||||
|
|
||||||
|
- name: Report SAT Errors as Annotations
|
||||||
|
uses: ghys/checkstyle-github-action@main
|
||||||
|
if: ${{ always() && ((steps.build.outcome == 'success') || (steps.build.outcome == 'failure')) }}
|
||||||
|
with:
|
||||||
|
title: CheckStyle Violations
|
||||||
|
path: '**/checkstyle-result.xml'
|
||||||
|
mode: inline
|
||||||
|
@ -28,10 +28,10 @@ import org.eclipse.jdt.annotation.NonNullByDefault;
|
|||||||
@NonNullByDefault
|
@NonNullByDefault
|
||||||
public abstract class ModbusSlaveErrorResponseException extends ModbusTransportException {
|
public abstract class ModbusSlaveErrorResponseException extends ModbusTransportException {
|
||||||
|
|
||||||
private static final Map<Integer, KnownExceptionCode> exceptionCodesIndex = new HashMap<>(10);
|
private static final Map<Integer, KnownExceptionCode> EXCEPTION_CODES_INDEX = new HashMap<>(10);
|
||||||
static {
|
static {
|
||||||
for (KnownExceptionCode code : KnownExceptionCode.values()) {
|
for (KnownExceptionCode code : KnownExceptionCode.values()) {
|
||||||
exceptionCodesIndex.put(code.exceptionCode, code);
|
EXCEPTION_CODES_INDEX.put(code.exceptionCode, code);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ public abstract class ModbusSlaveErrorResponseException extends ModbusTransportE
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<KnownExceptionCode> tryFromExceptionCode(int exceptionCode) {
|
public static Optional<KnownExceptionCode> tryFromExceptionCode(int exceptionCode) {
|
||||||
return Optional.ofNullable(exceptionCodesIndex.get(exceptionCode));
|
return Optional.ofNullable(EXCEPTION_CODES_INDEX.get(exceptionCode));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,8 +65,9 @@ public class ByteArrayFileCache {
|
|||||||
* disable this functionality.
|
* disable this functionality.
|
||||||
*/
|
*/
|
||||||
public ByteArrayFileCache(String servicePID, Duration expiry) {
|
public ByteArrayFileCache(String servicePID, Duration expiry) {
|
||||||
// TODO track and limit folder size
|
// possible to-dos:
|
||||||
// TODO support user specific folder
|
// - track and limit folder size
|
||||||
|
// - support user specific folder
|
||||||
cacheFolder = new File(new File(OpenHAB.getUserDataFolder(), CACHE_FOLDER_NAME), servicePID);
|
cacheFolder = new File(new File(OpenHAB.getUserDataFolder(), CACHE_FOLDER_NAME), servicePID);
|
||||||
if (!cacheFolder.exists()) {
|
if (!cacheFolder.exists()) {
|
||||||
logger.debug("Creating cache folder '{}'", cacheFolder.getAbsolutePath());
|
logger.debug("Creating cache folder '{}'", cacheFolder.getAbsolutePath());
|
||||||
|
@ -61,7 +61,6 @@ public class DecimalType extends Number implements PrimitiveType, State, Command
|
|||||||
* The English locale is used to determine (decimal/grouping) separator characters.
|
* The English locale is used to determine (decimal/grouping) separator characters.
|
||||||
*
|
*
|
||||||
* @param value the non null value representing a number
|
* @param value the non null value representing a number
|
||||||
*
|
|
||||||
* @throws NumberFormatException when the number could not be parsed to a {@link BigDecimal}
|
* @throws NumberFormatException when the number could not be parsed to a {@link BigDecimal}
|
||||||
*/
|
*/
|
||||||
public DecimalType(String value) {
|
public DecimalType(String value) {
|
||||||
@ -73,7 +72,6 @@ public class DecimalType extends Number implements PrimitiveType, State, Command
|
|||||||
*
|
*
|
||||||
* @param value the non null value representing a number
|
* @param value the non null value representing a number
|
||||||
* @param locale the locale used to determine (decimal/grouping) separator characters
|
* @param locale the locale used to determine (decimal/grouping) separator characters
|
||||||
*
|
|
||||||
* @throws NumberFormatException when the number could not be parsed to a {@link BigDecimal}
|
* @throws NumberFormatException when the number could not be parsed to a {@link BigDecimal}
|
||||||
*/
|
*/
|
||||||
public DecimalType(String value, Locale locale) {
|
public DecimalType(String value, Locale locale) {
|
||||||
@ -102,7 +100,6 @@ public class DecimalType extends Number implements PrimitiveType, State, Command
|
|||||||
*
|
*
|
||||||
* @param value the non null value representing a number
|
* @param value the non null value representing a number
|
||||||
* @return a new {@link DecimalType}
|
* @return a new {@link DecimalType}
|
||||||
*
|
|
||||||
* @throws NumberFormatException when the number could not be parsed to a {@link BigDecimal}
|
* @throws NumberFormatException when the number could not be parsed to a {@link BigDecimal}
|
||||||
*/
|
*/
|
||||||
public static DecimalType valueOf(String value) {
|
public static DecimalType valueOf(String value) {
|
||||||
|
@ -45,7 +45,6 @@ public class PercentType extends DecimalType {
|
|||||||
* Creates a new {@link PercentType} with the given value.
|
* Creates a new {@link PercentType} with the given value.
|
||||||
*
|
*
|
||||||
* @param value the value representing a percentage
|
* @param value the value representing a percentage
|
||||||
*
|
|
||||||
* @throws IllegalArgumentException when the value is not between 0 and 100
|
* @throws IllegalArgumentException when the value is not between 0 and 100
|
||||||
*/
|
*/
|
||||||
public PercentType(int value) {
|
public PercentType(int value) {
|
||||||
@ -58,7 +57,6 @@ public class PercentType extends DecimalType {
|
|||||||
* The English locale is used to determine (decimal/grouping) separator characters.
|
* The English locale is used to determine (decimal/grouping) separator characters.
|
||||||
*
|
*
|
||||||
* @param value the non null value representing a percentage
|
* @param value the non null value representing a percentage
|
||||||
*
|
|
||||||
* @throws NumberFormatException when the number could not be parsed to a {@link BigDecimal}
|
* @throws NumberFormatException when the number could not be parsed to a {@link BigDecimal}
|
||||||
* @throws IllegalArgumentException when the value is not between 0 and 100
|
* @throws IllegalArgumentException when the value is not between 0 and 100
|
||||||
*/
|
*/
|
||||||
@ -71,7 +69,6 @@ public class PercentType extends DecimalType {
|
|||||||
*
|
*
|
||||||
* @param value the non null value representing a percentage
|
* @param value the non null value representing a percentage
|
||||||
* @param locale the locale used to determine (decimal/grouping) separator characters
|
* @param locale the locale used to determine (decimal/grouping) separator characters
|
||||||
*
|
|
||||||
* @throws NumberFormatException when the number could not be parsed to a {@link BigDecimal}
|
* @throws NumberFormatException when the number could not be parsed to a {@link BigDecimal}
|
||||||
* @throws IllegalArgumentException when the value is not between 0 and 100
|
* @throws IllegalArgumentException when the value is not between 0 and 100
|
||||||
*/
|
*/
|
||||||
@ -84,7 +81,6 @@ public class PercentType extends DecimalType {
|
|||||||
* Creates a new {@link PercentType} with the given value.
|
* Creates a new {@link PercentType} with the given value.
|
||||||
*
|
*
|
||||||
* @param value the value representing a percentage.
|
* @param value the value representing a percentage.
|
||||||
*
|
|
||||||
* @throws IllegalArgumentException when the value is not between 0 and 100
|
* @throws IllegalArgumentException when the value is not between 0 and 100
|
||||||
*/
|
*/
|
||||||
public PercentType(BigDecimal value) {
|
public PercentType(BigDecimal value) {
|
||||||
@ -103,7 +99,6 @@ public class PercentType extends DecimalType {
|
|||||||
*
|
*
|
||||||
* @param value the non null value representing a percentage
|
* @param value the non null value representing a percentage
|
||||||
* @return new {@link PercentType}
|
* @return new {@link PercentType}
|
||||||
*
|
|
||||||
* @throws NumberFormatException when the number could not be parsed to a {@link BigDecimal}
|
* @throws NumberFormatException when the number could not be parsed to a {@link BigDecimal}
|
||||||
* @throws IllegalArgumentException when the value is not between 0 and 100
|
* @throws IllegalArgumentException when the value is not between 0 and 100
|
||||||
*/
|
*/
|
||||||
|
@ -99,7 +99,6 @@ public class QuantityType<T extends Quantity<T>> extends Number
|
|||||||
* The English locale is used to determine (decimal/grouping) separator characters.
|
* The English locale is used to determine (decimal/grouping) separator characters.
|
||||||
*
|
*
|
||||||
* @param value the non null value representing a quantity with an optional unit.
|
* @param value the non null value representing a quantity with an optional unit.
|
||||||
*
|
|
||||||
* @throws NumberFormatException when a quantity without a unit could not be parsed
|
* @throws NumberFormatException when a quantity without a unit could not be parsed
|
||||||
* @throws IllegalArgumentException when a quantity with a unit could not be parsed
|
* @throws IllegalArgumentException when a quantity with a unit could not be parsed
|
||||||
*/
|
*/
|
||||||
@ -113,7 +112,6 @@ public class QuantityType<T extends Quantity<T>> extends Number
|
|||||||
*
|
*
|
||||||
* @param value the non null value representing a quantity with an optional unit.
|
* @param value the non null value representing a quantity with an optional unit.
|
||||||
* @param locale the locale used to determine (decimal/grouping) separator characters.
|
* @param locale the locale used to determine (decimal/grouping) separator characters.
|
||||||
*
|
|
||||||
* @throws NumberFormatException when a quantity without a unit could not be parsed
|
* @throws NumberFormatException when a quantity without a unit could not be parsed
|
||||||
* @throws IllegalArgumentException when a quantity with a unit could not be parsed
|
* @throws IllegalArgumentException when a quantity with a unit could not be parsed
|
||||||
*/
|
*/
|
||||||
@ -201,7 +199,6 @@ public class QuantityType<T extends Quantity<T>> extends Number
|
|||||||
*
|
*
|
||||||
* @param value the non null value representing a quantity with an optional unit
|
* @param value the non null value representing a quantity with an optional unit
|
||||||
* @return a new {@link QuantityType}
|
* @return a new {@link QuantityType}
|
||||||
*
|
|
||||||
* @throws NumberFormatException when a quantity without a unit could not be parsed
|
* @throws NumberFormatException when a quantity without a unit could not be parsed
|
||||||
* @throws IllegalArgumentException when a quantity with a unit could not be parsed
|
* @throws IllegalArgumentException when a quantity with a unit could not be parsed
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user